Commit 165b1b0c authored by georg's avatar georg

Merge branch 'build_docker_image' into 'master'

Build docker image from CI

See merge request schleuder/schleuder!129
parents b2801a61 d055a67d
---
stages:
- test
- docker
cache:
key: "$CI_PROJECT_PATH-$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
paths:
......@@ -13,7 +18,7 @@ before_script:
- eatmydata bundle install --jobs $(nproc) --path vendor
- rm /dev/random && ln -s /dev/urandom /dev/random
- SCHLEUDER_ENV=test SCHLEUDER_CONFIG=spec/schleuder.yml eatmydata bundle exec rake db:create db:schema:load
ruby:2.1:
image: ruby:2.1
script:
......@@ -36,9 +41,29 @@ ruby:2.5:
- eatmydata bundle exec rspec
bundler:audit:
image: ruby:2.4
script:
- gem install bundler-audit
- bundle install --jobs $(nproc) --path vendor
- bundle-audit update
- bundle-audit check
allow_failure: true
build_docker_image:
stage: docker
tags:
- docker-in-docker
before_script:
- docker info
image: docker:latest
services:
- docker:dind
variables:
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
DOCKER_DRIVER: overlay2
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
script:
- docker build -t $IMAGE_TAG .
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker push $IMAGE_TAG
FROM ruby:2.4
MAINTAINER Friedrich Lindenberg <pudo@occrp.org>, Michał "rysiek" Woźniak <rysiek@occrp.org>
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y \
libmagic-dev \
libgpgme11-dev \
wget \
git \
git-core \
inotify-tools \
--no-install-recommends && rm -rf /var/lib/apt/lists/*
# install schleuder
WORKDIR /opt/schleuder
ADD . /opt/schleuder
RUN cd /opt/schleuder && \
bundle install
# get and install schleuder-cli
# not required, but helpful for CLI-based list administration
RUN git clone https://0xacab.org/schleuder/schleuder-cli.git /opt/schleuder-cli && \
cd /opt/schleuder-cli && \
bundle install
# entrypoint script
COPY docker/entrypoint.sh /sbin/entrypoint.sh
RUN chmod a+x /sbin/entrypoint.sh
# we need to be able to mount the code into other containers
# like the SMTPD container
# so that schleuder work can be run if needed
VOLUME ["/usr/local/bundle", "/etc/schleuder", "/var/lib/schleuder/lists"]
# final config
EXPOSE 4443
ENTRYPOINT ["/sbin/entrypoint.sh"]
CMD ["schleuder-api-daemon"]
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment