From 842c34e8a4d6c3e02484896064ae9ae2e9f8a30b Mon Sep 17 00:00:00 2001 From: Alexey Remizov Date: Wed, 10 Jan 2018 15:15:30 +0300 Subject: [PATCH] Configured GitLab CI --- .gitlab-ci.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..35b8669 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,36 @@ +variables: + DOCKER_DRIVER: overlay + REPO_NAME: registry.gitlab.com/alxrem/prometheus-logstash-exporter + +build_test_image: + variables: + TAG: $CI_COMMIT_REF_SLUG + image: docker:latest + services: + - docker:dind + stage: build + only: + - branches + except: + - master + when: manual + script: + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com + - docker build -t $REPO_NAME:$TAG . + - docker push $REPO_NAME:$TAG + +build_release_image: + variables: + TAG: $CI_COMMIT_TAG + image: docker:latest + services: + - docker:dind + stage: build + only: + - tags + script: + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com + - docker build -t $REPO_NAME:$TAG . + - docker tag $REPO_NAME:$TAG $REPO_NAME:latest + - docker push $REPO_NAME:$TAG + - docker push $REPO_NAME:latest