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

View file

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