summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kiryukhin <alexander@kiryukhin.su>2019-01-31 01:04:17 +0300
committerAlexander Kiryukhin <alexander@kiryukhin.su>2019-01-31 01:04:17 +0300
commita4f6680ca645855e23108272beae39d9e540be6d (patch)
tree3dd025f3690084c820a04fa45c1873b8a1f7761b
parent91c16487472cb23671ffdc9c230120441f85b620 (diff)
Gitlab CI
-rw-r--r--.gitlab-ci.yml40
1 files changed, 40 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..aae55f1
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,40 @@
+stages:
+ - test
+ - build
+ - deploy
+
+variables:
+ SERVICE_NAME: 'reviewer-bot'
+
+.build-master: &build-master
+ stage: build
+ script:
+ - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
+ - docker build --build-arg MODE=$MODE --build-arg PROXY=${PROXY} -t $CI_REGISTRY_IMAGE/$MODE:$CI_PIPELINE_IID -t $CI_REGISTRY_IMAGE/$MODE:latest .
+ - docker push $CI_REGISTRY_IMAGE/$MODE:$CI_PIPELINE_IID
+ - docker push $CI_REGISTRY_IMAGE/$MODE:latest
+ only:
+ - master
+ tags:
+ - dev-b2b
+
+build daemon:
+ <<: *build-master
+ variables:
+ MODE: daemon
+
+.deploy: &deploy
+ stage: deploy
+ script:
+ - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
+ - docker pull $CI_REGISTRY_IMAGE/$MODE:$CI_PIPELINE_IID
+ - docker service update --image $CI_REGISTRY_IMAGE/$MODE:$CI_PIPELINE_IID $SERVICE_NAME-$MODE
+ tags:
+ - dev-b2b
+
+deploy daemon:
+ <<: *deploy
+ variables:
+ MODE: daemon
+ only:
+ - master \ No newline at end of file