Docker tagging options + Docker release tagging

This commit is contained in:
etienne-napoleone 2018-07-25 16:10:24 +07:00
parent 08ec57c99c
commit 07a4c33033
No known key found for this signature in database
GPG key ID: 13183AEB698F46A9
2 changed files with 17 additions and 6 deletions

View file

@ -6,6 +6,7 @@ before_install: skip
jobs:
include:
- stage: Lint
os: linux
sudo: false
@ -15,6 +16,7 @@ jobs:
submodules: false
script:
- go run build/ci.go lint
- stage: Build and test
os: linux
dist: trusty
@ -38,7 +40,8 @@ jobs:
- while sleep 540; do echo "[ still running ]"; done &
- go run build/ci.go test -coverage
- kill %1
- stage: Build and push tomochain/tomochain and tomochain/bootnode containers
- stage: Build and push Docker image
services:
- docker
before_install:
@ -46,16 +49,24 @@ jobs:
- docker run tomochain/tomochain
deploy:
provider: script
script: bash docker_push.sh
script: bash docker_push.sh $TRAVIS_BUILD_ID
on:
branch: master
- stage: Trigger rebuild of tomochain/infra-tomochain image
branch: master AND tag = false
deploy:
provider: script
script: bash docker_push.sh $TRAVIS_TAG
on:
branch: master AND tag = true
- stage: Trigger rebuild of infrastructure image
sudo: false
script: bash docker_rebuild.sh
stages:
- name: Lint
- name: Build and test
- name: Github release
if: type != pull_request AND branch = master AND tag = true
- name: Build and push Docker image
if: type != pull_request AND branch = master
- name: Trigger rebuild of infrastructure image

View file

@ -2,6 +2,6 @@
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
docker tag tomochain/tomochain tomochain/tomochain:latest
docker tag tomochain/tomochain tomochain/tomochain:$TRAVIS_BUILD_ID
docker tag tomochain/tomochain tomochain/tomochain:$1
docker push tomochain/tomochain:latest
docker push tomochain/tomochain:$TRAVIS_BUILD_ID
docker push tomochain/tomochain:$1