Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Commit

Permalink
Fix docker deployment (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
ansermino authored Oct 5, 2020
1 parent 517ac2a commit 1e62027
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ cache: cargo
env:
global:
- RUST_BACKTRACE=1
- IMAGE_NAME="chainsafe/chainbridge-substrate-chain"

before_install:
- df -h
Expand All @@ -18,14 +19,14 @@ jobs:
- stage: "Build"
name: Build (WASM and native)
script:
- RUST_TOOLCHAIN=nightly-2020-08-16 TARGET=build-client travis_wait 180 ./scripts/ci.sh
- travis_wait 180 docker build -t $IMAGE_NAME:latest .
deploy:
- provider: script
script: TARGET=default travis_wait 180 ./scripts/ci_docker.sh
script: TARGET=default ./scripts/ci_docker.sh
on:
branch: master
- provider: script
script: TAG=$TRAVIS_TAG TARGET=release travis_wait 180 ./scripts/ci_docker.sh
script: TAG=$TRAVIS_TAG TARGET=release ./scripts/ci_docker.sh
on:
tags: true

Expand Down
9 changes: 3 additions & 6 deletions scripts/ci_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,15 @@ TAG=${TAG:-"${TIMESTAMP}-${GIT_SHORT_COMMIT}"}

case $TARGET in
"default")
echo "Pushing image with tags \"latest\" and \"$TAG\""
docker build $BUILD_ARGS -t ${IMAGE_NAME}:${TAG} .
docker tag "${IMAGE_NAME}:${TAG}" "${IMAGE_NAME}:latest"
echo "Pushing image with tag $TAG"
docker tag ${IMAGE_NAME}:latest ${IMAGE_NAME}:${TAG}
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker push ${IMAGE_NAME}:latest
docker push ${IMAGE_NAME}:${TAG}
;;

"release")
echo "Pushing image with tag $TAG"
docker build $BUILD_ARGS -t ${IMAGE_NAME}:${TAG} .
docker tag "${IMAGE_NAME}:${TAG}"
docker tag ${IMAGE_NAME}:latest ${IMAGE_NAME}:${TAG}
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker push ${IMAGE_NAME}:${TAG}
;;
Expand Down

0 comments on commit 1e62027

Please sign in to comment.