-
Notifications
You must be signed in to change notification settings - Fork 678
Publish latest images from CI on successful builds. #1337
Conversation
This does a lot less than Why does this not just invoke |
The only thing it doesn't do is tag the image with the github revision. So not "a lot less".
We'll still know what people are running because the binaries have the git version encoded in them.
I didn't know about make publish. How does tagging the image with the git ref help? If I pull weaveworks/weave:latest, I end up with an image tagged with latest (and not with the git ref). Docker doesn't seem to pull the other tags, and the docker hub is less than helpful: https://hub.docker.com/r/weaveworks/weave/tags/ |
Good point. That means our weavexec version reporting won't work for snapshot releases. Which is annoying. File a bug. The tag is still useful because it allows us to point people at specific revisions, e.g. |
1f0bbd2
to
cfa9380
Compare
I also move the git-version-tagging to the docker build stage - if you'd done a commit between doing a make and a make publish you'd be tagging with the wrong version. |
Good idea, but needs a separate issue. |
@@ -83,7 +83,7 @@ $(WEAVEWAIT_EXE) $(SIGPROXY_EXE) $(COVER_EXE) $(RUNNER_EXE): | |||
go build -o $@ ./$(@D) | |||
|
|||
$(WEAVER_UPTODATE): prog/weaver/Dockerfile $(WEAVER_EXE) | |||
$(SUDO) docker build -t $(WEAVER_IMAGE) prog/weaver | |||
$(SUDO) docker build -t $(WEAVER_IMAGE) -t $(WEAVER_IMAGE):$(WEAVE_VERSION) prog/weaver |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
I also wonder whether the version tagging ends up creating a trail of garbage. i.e. when performing repeated builds, will all those images be left lying around? Though perhaps that is happening anyway. |
Kinda, yeah. When doing repeated builds on the same cset, it doesn't. But when you git pull or checkout a new one, it does - and they are not cleaned up by the rmi dangling.
|
ca0aad0
to
8a7821a
Compare
That's not great. I think there's a better fix: --- a/Makefile
+++ b/Makefile
@@ -105,7 +105,7 @@ $(DOCKER_DISTRIB):
tests: $(COVER_EXE)
@test/units.sh
-$(PUBLISH): publish_%:
+$(PUBLISH): publish_%: $(IMAGES_UPTODATE)
$(SUDO) docker tag -f $(DOCKERHUB_USER)/$* $(DOCKERHUB_USER)/$*:$(WEAVE_VERSION)
$(SUDO) docker push $(DOCKERHUB_USER)/$*:$(WEAVE_VERSION)
$(SUDO) docker push $(DOCKERHUB_USER)/$*:latest I think this does the right thing, namely ensure that images are up to date before publishing them. And some quick testing appears to confirm that. But the |
Having re-read the GNU make documentation, it does. So I have applied this change to master. PR lgtm, but I don't know enough about circle, e.g. where do the credentials for the |
I've put the credentials in the circle environment manually. |
Publish latest images from CI on successful builds.
Fixes #1295