From 3d894ed250295dc8f52739ef0a598e13891a21fb Mon Sep 17 00:00:00 2001 From: etienne-napoleone Date: Tue, 31 Jul 2018 16:48:05 +0700 Subject: [PATCH] Fix .travis.yml --- .travis.yml | 56 ++++++++++++++++++++++++----------------------- docker_push.sh | 5 ----- docker_rebuild.sh | 1 - 3 files changed, 29 insertions(+), 33 deletions(-) delete mode 100755 docker_push.sh delete mode 100755 docker_rebuild.sh diff --git a/.travis.yml b/.travis.yml index cbbc5a6a67b1..082518d6e310 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ sudo: required language: go go_import_path: github.com/ethereum/go-ethereum -services: skip jobs: include: @@ -54,44 +53,47 @@ jobs: branch: master tags: true - - stage: Build and push tomochain/tomochain image + - stage: Build and push untagged commit into image tomochain services: - docker - before_install: + install: skip + before_script: - docker build -t tomochain/tomochain . - docker run tomochain/tomochain - install: skip - script: skip - deploy: - - provider: script - script: - - bash docker_push.sh latest - - bash docker_push.sh $TRAVIS_BUILD_ID - on: - branch: master - tags: false - - provider: script - script: - - bash docker_push.sh latest - - bash docker_push.sh $TRAVIS_TAG - on: - branch: master - tags: true + script: + - echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin + - docker tag tomochain/tomochain tomochain/tomochain:latest + - docker push tomochain/tomochain:latest + - docker tag tomochain/tomochain tomochain/tomochain:$TRAVIS_BUILD_ID + - docker push tomochain/tomochain:$TRAVIS_BUILD_ID + after_success: + - curl -X POST $INFRA_IMAGE_REBUILD_HOOK - - stage: Trigger rebuild of tomochain/infra-tomochain image - sudo: false + - stage: Build and push tagged commit into image tomochain + services: + - docker install: skip - script: bash docker_rebuild.sh + before_script: + - docker build -t tomochain/tomochain . + - docker run tomochain/tomochain + script: + - echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin + - docker tag tomochain/tomochain tomochain/tomochain:latest + - docker push tomochain/tomochain:latest + - docker tag tomochain/tomochain tomochain/tomochain:$TRAVIS_TAG + - docker push tomochain/tomochain:$TRAVIS_TAG + after_success: + - curl -X POST $INFRA_IMAGE_REBUILD_HOOK stages: - name: Lint - name: Build and test - name: Github release if: type != pull_request AND branch = master AND tag = true AND repo = tomochain/tomochain - - name: Build and push tomochain/tomochain image - if: type != pull_request AND branch = master AND repo = tomochain/tomochain - - name: Trigger rebuild of tomochain/infra-tomochain image - if: type != pull_request AND branch = master AND repo = tomochain/tomochain + - name: Build and push untagged commit into image tomochain + if: type != pull_request AND branch = master AND tag = false AND repo = tomochain/tomochain + - name: Build and push tagged commit into image tomochain + if: type != pull_request AND branch = master AND tag = true AND repo = tomochain/tomochain notifications: slack: diff --git a/docker_push.sh b/docker_push.sh deleted file mode 100755 index bc708c27307b..000000000000 --- a/docker_push.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin -docker tag tomochain/tomochain tomochain/tomochain:$1 -docker push tomochain/tomochain:$1 diff --git a/docker_rebuild.sh b/docker_rebuild.sh deleted file mode 100755 index 7b88f346a25d..000000000000 --- a/docker_rebuild.sh +++ /dev/null @@ -1 +0,0 @@ -curl -X POST $INFRA_IMAGE_REBUILD_HOOK