From c2cf1cee53b514c552095ab987abee7ee6809100 Mon Sep 17 00:00:00 2001 From: Vasilis Tsiligiannis Date: Sat, 10 Nov 2018 15:06:50 +0200 Subject: [PATCH] gitlab-ci: Push Docker image to GitLab registry Signed-off-by: Vasilis Tsiligiannis --- .gitlab-ci.yml | 17 +++++++++++++++++ docker-compose.yml | 1 + 2 files changed, 18 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cab0cef..bf5cafb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,6 +14,23 @@ test: - eslint 'db/static/js/*.js' - stylelint 'db/static/css/*.css' +docker: + stage: deploy + image: docker:latest + services: + - docker:dind + before_script: + - apk --update add py-pip + - pip install docker-compose + script: + - docker-compose build --no-cache --pull + - docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $CI_REGISTRY + - docker tag satnogs-db:latest $CI_REGISTRY_IMAGE/satnogs-db:$CI_COMMIT_REF_NAME + - docker push $CI_REGISTRY_IMAGE/satnogs-db:$CI_COMMIT_REF_NAME + only: + - master + - dev + stage: stage: deploy environment: stage diff --git a/docker-compose.yml b/docker-compose.yml index c458296..cfaf045 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,6 +24,7 @@ services: web: build: context: '.' + image: 'satnogs-db' ports: - '8000:8000' links: