From 74fa9dca8c6b0fc957d03ed9276852db69554f96 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 9 Nov 2020 10:04:55 +0100 Subject: [PATCH] Build docker from CI and move docker-compose config in another repo https://framagit.org/framasoft/joinmobilizon/docker Signed-off-by: Thomas Citharel --- .gitlab-ci.yml | 27 ++++++++++++++++++ docker/production/docker-compose.yml | 42 ---------------------------- docker/production/env.template | 20 ------------- 3 files changed, 27 insertions(+), 62 deletions(-) delete mode 100644 docker/production/docker-compose.yml delete mode 100644 docker/production/env.template diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4a6efdf2f..d17f4d6dd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,6 +4,7 @@ stages: - check - test - deploy + - docker variables: MIX_ENV: "test" @@ -121,3 +122,29 @@ exunit: # expire_in: 1 hour # paths: # - public + +.docker: &docker + stage: docker + cache: {} + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] + before_script: + - mkdir -p /kaniko/.docker + - echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$CI_REGISTRY_AUTH\",\"email\":\"$CI_REGISTRY_EMAIL\"}}}" > /kaniko/.docker/config.json + script: + - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/docker/production/Dockerfile --destination $DOCKER_IMAGE_NAME + +build-docker-master: + <<: *docker + only: + - schedules + variables: + DOCKER_IMAGE_NAME: framasoft/mobilizon:master + +build-docker-tag: + <<: *docker + only: + - tags + variables: + DOCKER_IMAGE_NAME: framasoft/mobilizon:$CI_COMMIT_TAG diff --git a/docker/production/docker-compose.yml b/docker/production/docker-compose.yml deleted file mode 100644 index 7fe4824d9..000000000 --- a/docker/production/docker-compose.yml +++ /dev/null @@ -1,42 +0,0 @@ -version: "3" - -services: - mobilizon: - image: framasoft/mobilizon - environment: - - MOBILIZON_INSTANCE_NAME - - MOBILIZON_INSTANCE_HOST - - MOBILIZON_INSTANCE_EMAIL - - MOBILIZON_REPLY_EMAIL - - MOBILIZON_ADMIN_EMAIL - - MOBILIZON_INSTANCE_REGISTRATIONS_OPEN - - MOBILIZON_DATABASE_USERNAME=${POSTGRES_USER} - - MOBILIZON_DATABASE_PASSWORD=${POSTGRES_PASSWORD} - - MOBILIZON_DATABASE_DBNAME=${POSTGRES_DB} - - MOBILIZON_DATABASE_HOST=db - - MOBILIZON_INSTANCE_SECRET_KEY_BASE - - MOBILIZON_INSTANCE_SECRET_KEY - - MOBILIZON_SMTP_SERVER - - MOBILIZON_SMTP_HOSTNAME - - MOBILIZON_SMTP_PORT - - MOBILIZON_SMTP_SSL - - MOBILIZON_SMTP_USERNAME - - MOBILIZON_SMTP_PASSWORD - volumes: - - ./public/uploads:/app/uploads - ports: - - "4000:4000" - - db: - image: postgis/postgis - volumes: - - ./db:/var/lib/postgresql/data - environment: - - POSTGRES_USER - - POSTGRES_PASSWORD - - POSTGRES_DB - -networks: - default: - ipam: - driver: default diff --git a/docker/production/env.template b/docker/production/env.template deleted file mode 100644 index 6a037b6c2..000000000 --- a/docker/production/env.template +++ /dev/null @@ -1,20 +0,0 @@ -# Copy this file to .env, then update it with your own settings - -# Database settings -POSTGRES_USER=mobilizon -POSTGRES_PASSWORD=changethis -POSTGRES_DB=mobilizon - -# Instance configuration -MOBILIZON_INSTANCE_NAME=My Mobilizon Instance -MOBILIZON_INSTANCE_HOST=mobilizon.lan -MOBILIZON_INSTANCE_SECRET_KEY_BASE=changethis -MOBILIZON_INSTANCE_SECRET_KEY=changethis -MOBILIZON_INSTANCE_EMAIL=noreply@mobilizon.lan -MOBILIZON_REPLY_EMAIL=contact@mobilizon.lan - -# Email settings -MOBILIZON_SMTP_SERVER=localhost -MOBILIZON_SMTP_HOSTNAME=localhost -MOBILIZON_SMTP_USERNAME=noreply@mobilizon.lan -MOBILIZON_SMTP_PASSWORD=password