summaryrefslogtreecommitdiffstats
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorJan Tuomi <jan.tuomi@eficode.com>2019-12-28 21:35:01 +0200
committerJan Tuomi <jan.tuomi@eficode.com>2019-12-28 21:35:01 +0200
commit3b50c13ca1691e64ae9382ec658216b49477088e (patch)
treec622c6174ecd073874daac6eda151ec5a64d95de /.gitlab-ci.yml
Initial commit
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml26
1 files changed, 26 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..e7805c5
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,26 @@
+stages:
+ - publish
+ - deploy
+
+publish:
+ stage: publish
+ image: docker:stable
+ services:
+ - docker:stable-dind
+ only:
+ - tags
+ script:
+ - docker info
+ - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
+ - IMAGE="$IMAGE_NAME:$CI_COMMIT_TAG"
+ - IMAGE_LATEST="$IMAGE_NAME:latest"
+ - docker build . -f ./Dockerfile -t "$IMAGE"
+ - docker tag "$IMAGE" "$IMAGE_LATEST"
+ - docker push $IMAGE
+ - docker push $IMAGE_LATEST
+
+deploy:
+ stage: deploy
+ image: ansible
+ script:
+ - ansible-playbook -i "$DEPLOY_HOST" ansible/deploy-playbook.yaml --extra-vars "image_name=$IMAGE"