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/*/'
|
SOURCE_CODE_PATH: 'ChaosBot/*/'
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
|
- version
|
||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
- release
|
- release
|
||||||
@ -29,6 +30,22 @@ cache:
|
|||||||
#
|
#
|
||||||
policy: pull-push
|
policy: pull-push
|
||||||
|
|
||||||
|
version:
|
||||||
|
stage: version
|
||||||
|
only:
|
||||||
|
changes:
|
||||||
|
- ChaosBot/**/*
|
||||||
|
refs:
|
||||||
|
- master
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
- hawkeye
|
||||||
|
script:
|
||||||
|
- 'git describe --tags > version'
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- version
|
||||||
|
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
only:
|
only:
|
||||||
@ -96,12 +113,12 @@ docker:
|
|||||||
# Log in to the registry
|
# Log in to the registry
|
||||||
- 'docker login -u=$REGISTRY_USER -p=$REGISTRY_PASS registry.chaoticlogic.us'
|
- 'docker login -u=$REGISTRY_USER -p=$REGISTRY_PASS registry.chaoticlogic.us'
|
||||||
# Build the image
|
# 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
|
# 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:`cat version` 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:latest'
|
||||||
# Push the registry images
|
# 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'
|
- 'docker -H unix:///var/run/docker.sock image push registry.chaoticlogic.us/chaosbot:latest'
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user