Skip to content

Commit

Permalink
add docker push instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
zkhan12 committed Apr 15, 2020
1 parent 3521cf2 commit 74edd08
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ services:

before_install:
- docker build -t hbclab/accel-bids -f Dockerfile_exec .
- echo "$DOCKER_PASS" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker push hbclab/accel-bids:latest

script:
- docker run --entrypoint /bin/bash hbclab/accel-bids -c ". activate accel; pytest /home/coder/projects"

deploy:
provider: script
script: bash docker_push.sh
on:
branch: master
tags: true
9 changes: 9 additions & 0 deletions docker_push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
echo "$DOCKER_PASS" | docker login --username "$DOCKER_USERNAME" --password-stdin
# if tag is defined
if [[ ! -z "$TRAVIS_TAG"]]; then
docker push hbclab/accel-bids:$TRAVIS_TAG
# if the build is on the master branch
elif [[ "$TRAVIS_BRANCH" == "master" ]]; then
docker push hbclab/accel-bids:unstable
else
echo "This build is not on the master branch or a tagged release"

0 comments on commit 74edd08

Please sign in to comment.