Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push a master-tagged image #142

Merged
merged 4 commits into from
Oct 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Copy link
Contributor

@aschmolck aschmolck Oct 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you want TRAVIS_TAG here somwhere? I don't get how we'd still get correctly v3.2.1 style tagged docker images with this (since what you docker push is always tagged as master, as far as I can tell).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the Travis docs (https://docs.travis-ci.com/user/environment-variables/#default-environment-variables):
TRAVIS_BRANCH: for builds triggered by a tag, this is the same as the name of the tag (TRAVIS_TAG).
So I think this should work as expected.

env:
global:
# smarkets ci docker username
Expand Down
19 changes: 13 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
VERSION?=$$(git rev-parse --abbrev-ref HEAD)

requirements_frozen.txt requirements.nix requirements_override.nix: requirements.txt
pypi2nix -V 3.6 -r $^

Expand All @@ -24,11 +26,16 @@ 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 push smarkets/marge-bot:latest
docker tag smarkets/marge-bot:$$(cat version) smarkets/marge-bot:$(VERSION)
if [ "$(VERSION)" = "$$(cat version)" ]; then \
docker tag smarkets/marge-bot:$$(cat version) smarkets/marge-bot:latest
docker tag smarkets/marge-bot:$$(cat version) smarkets/marge-bot:stable; \
docker push smarkets/marge-bot:stable; \
docker push smarkets/marge-bot:latest; \
fi
docker push smarkets/marge-bot:$(VERSION)
# 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:$$(cat version) smarketshq/marge-bot:latest
docker tag smarkets/marge-bot:$$(cat version) smarketshq/marge-bot:$(VERSION)
docker push smarketshq/marge-bot:$(VERSION)
docker push smarketshq/marge-bot:latest
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,15 @@ docker run --restart=on-failure \
--config-file=/configuration/marge-bot-config.yaml
```

By default docker will use the `latest` tag, which corresponds to the latest
stable version. You can also use the `stable` tag to make this more explicit.
If you want a development version, you can use the `master` tag to obtain an
image built from the HEAD commit of the `master` branch. Note that this image
may contain bugs.

You can also specify a particular version as a tag, e.g.
`smarkets/marge-bot:0.7.0`.

### Running marge-bot in kubernetes
It's also possible to run marge in kubernetes, e.g. here's how you use a ktmpl
template:
Expand Down