Skip to content
This repository has been archived by the owner on Mar 30, 2024. It is now read-only.

Commit

Permalink
Configured GitLab CI
Browse files Browse the repository at this point in the history
  • Loading branch information
alxrem committed Jan 10, 2018
1 parent 000f37e commit 842c34e
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 842c34e

Please sign in to comment.