Skip to content

Commit

Permalink
Push a master-tagged image
Browse files Browse the repository at this point in the history
Push a new docker image with tag "master" for every new build on the
master branch. This gives users wishing to run with the latest
development changes an easy way to stay up to date.

Note: when a tag is created, Travis sets the $TRAVIS_BRANCH envvar to
the tag, rather than the branch, hence why we only use this variable
now.
  • Loading branch information
JaimeLennox committed Oct 13, 2018
1 parent 5618678 commit ecfb007
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ services:
language: nix
deploy:
provider: script
script: make dockerize && make docker-push
script: make dockerize && make docker-push VERSION="$TRAVIS_BRANCH"
on:
repo: smarkets/marge-bot
tags: true
condition: "$TRAVIS_TAG = $(cat version)"
all_branches: true
condition: "$TRAVIS_BRANCH = $(cat version) || $TRAVIS_BRANCH = master"
env:
global:
# smarkets ci docker username
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ docker-push:
else \
docker login; \
fi
docker tag smarkets/marge-bot:$$(cat version) smarkets/marge-bot:latest
docker push smarkets/marge-bot:$$(cat version)
docker tag smarkets/marge-bot:$(VERSION) smarkets/marge-bot:latest
docker push smarkets/marge-bot:$(VERSION)
docker push smarkets/marge-bot:latest
# for backwards compatibility push to previous location
docker tag smarkets/marge-bot:latest smarketshq/marge-bot:latest
docker tag smarkets/marge-bot:latest smarketshq/marge-bot:$$(cat version)
docker push smarketshq/marge-bot:$$(cat version)
docker tag smarkets/marge-bot:latest smarketshq/marge-bot:$(VERSION)
docker push smarketshq/marge-bot:$(VERSION)
docker push smarketshq/marge-bot:latest

0 comments on commit ecfb007

Please sign in to comment.