Switch to using a versioning system based on tags
This commit is contained in:
parent
885bbc0e7f
commit
e1e898981b
@ -8,6 +8,7 @@ variables:
|
||||
SOURCE_CODE_PATH: 'ChaosBot/*/'
|
||||
|
||||
stages:
|
||||
- version
|
||||
- build
|
||||
- test
|
||||
- release
|
||||
@ -29,6 +30,22 @@ cache:
|
||||
#
|
||||
policy: pull-push
|
||||
|
||||
version:
|
||||
stage: version
|
||||
only:
|
||||
changes:
|
||||
- ChaosBot/**/*
|
||||
refs:
|
||||
- master
|
||||
tags:
|
||||
- docker
|
||||
- hawkeye
|
||||
script:
|
||||
- 'git describe --tags > version'
|
||||
artifacts:
|
||||
paths:
|
||||
- version
|
||||
|
||||
build:
|
||||
stage: build
|
||||
only:
|
||||
@ -96,12 +113,12 @@ docker:
|
||||
# Log in to the registry
|
||||
- 'docker login -u=$REGISTRY_USER -p=$REGISTRY_PASS registry.chaoticlogic.us'
|
||||
# Build the image
|
||||
- 'docker -H unix:///var/run/docker.sock image build -t chaosbot:$CI_COMMIT_SHA ./'
|
||||
- 'docker -H unix:///var/run/docker.sock image build -t chaosbot:`cat version` ./'
|
||||
# Tag the image with a registry tag
|
||||
- 'docker -H unix:///var/run/docker.sock image tag chaosbot:$CI_COMMIT_SHA registry.chaoticlogic.us/chaosbot:$CI_COMMIT_SHA'
|
||||
- 'docker -H unix:///var/run/docker.sock image tag chaosbot:$CI_COMMIT_SHA registry.chaoticlogic.us/chaosbot:latest'
|
||||
- 'docker -H unix:///var/run/docker.sock image tag chaosbot:`cat version` registry.chaoticlogic.us/chaosbot:$CI_COMMIT_SHA'
|
||||
- 'docker -H unix:///var/run/docker.sock image tag chaosbot:`cat version` registry.chaoticlogic.us/chaosbot:latest'
|
||||
# Push the registry images
|
||||
- 'docker -H unix:///var/run/docker.sock image push registry.chaoticlogic.us/chaosbot:$CI_COMMIT_SHA'
|
||||
- 'docker -H unix:///var/run/docker.sock image push registry.chaoticlogic.us/chaosbot:`cat version`'
|
||||
- 'docker -H unix:///var/run/docker.sock image push registry.chaoticlogic.us/chaosbot:latest'
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user