diff --git a/Makefile b/Makefile index 4fc0eec6..6dc8e441 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ +PUBLISH=publish_weave publish_weavedns publish_weavetools + .DEFAULT: all -.PHONY: all update tests clean +.PHONY: all update tests publish $(PUBLISH) clean # If you can use docker without being root, you can do "make SUDO=" SUDO=sudo @@ -55,6 +57,13 @@ $(WEAVETOOLS_EXPORT): tools/Dockerfile $(WEAVETOOLS_EXES) tests: cd nameserver; go test -tags netgo +$(PUBLISH): publish_%: + $(SUDO) docker tag $(DOCKERHUB_USER)/$* $(DOCKERHUB_USER)/$*:$(WEAVE_VERSION) + $(SUDO) docker push $(DOCKERHUB_USER)/$*:$(WEAVE_VERSION) + $(SUDO) docker push $(DOCKERHUB_USER)/$*:latest + +publish: $(PUBLISH) + clean: -$(SUDO) docker rmi $(WEAVER_IMAGE) $(WEAVEDNS_IMAGE) $(WEAVETOOLS_IMAGE) rm -f $(WEAVER_EXE) $(WEAVEDNS_EXE) $(WEAVER_EXPORT) $(WEAVEDNS_EXPORT) $(WEAVETOOLS_EXPORT) diff --git a/bin/release b/bin/release index 4c8a3112..185c0614 100755 --- a/bin/release +++ b/bin/release @@ -120,13 +120,8 @@ publish() { echo '** Sanity checks OK for publishing tag' $LATEST_TAG as $DOCKERHUB_USER/weave:$VERSION - for IMAGE in weave weavedns weavetools ; do - echo == Tagging $DOCKERHUB_USER/$IMAGE as $VERSION - $SUDO docker tag $DOCKERHUB_USER/$IMAGE $DOCKERHUB_USER/$IMAGE:$VERSION - $SUDO docker push $DOCKERHUB_USER/$IMAGE:$VERSION - $SUDO docker push $DOCKERHUB_USER/$IMAGE:latest - echo "** Pushed $DOCKERHUB_USER/$IMAGE:$VERSION to docker hub" - done + echo "== Tagging and publishing images on docker hub as user $DOCKERHUB_USER" + make SUDO=$SUDO WEAVE_VERSION=$VERSION DOCKERHUB_USER=$DOCKERHUB_USER publish echo "== Creating GitHub release $RELEASE_NAME $VERSION" # This cannot be done as a draft because of a bug in