build: cleanup docker images after publish

This commit is contained in:
Bassam Tabbara committed 2017-04-04 17:01:39 -07:00
1 parent eeb2656b1f
commit babcc79603
5 files changed
+28 -1

No files matched your search

+7
View File
@@ -236,6 +236,13 @@ else
@echo skipping publish. invalid channel "$(CHANNEL)"
endif
publish.cleanup:
ifneq ($(filter master alpha beta stable, $(CHANNEL)),)
@$(MAKE) release.cleanup
else
@echo skipping publish.cleanup. invalid channel "$(CHANNEL)"
endif
.PHONY: build.common cross.build cross.parallel
.PHONY: dev build install test check vet fmt vendor clean distclean cross release publish
+7
View File
@@ -76,6 +76,11 @@ release.publish.$(1).$(2):
@build/release/release.sh publish $(2) $(1)
release.publish.all: release.publish.$(1).$(2)
release.cleanup.$(1).$(2):
@build/release/release.sh cleanup $(2) $(1)
release.cleanup.all: release.cleanup.$(1).$(2)
endef
$(foreach f,$(RELEASE_FLAVORS),$(foreach p,$(RELEASE_PLATFORMS), $(eval $(call release-target,$(f),$(p)))))
@@ -83,3 +88,5 @@ $(foreach f,$(RELEASE_FLAVORS),$(foreach p,$(RELEASE_PLATFORMS), $(eval $(call r
release.build: release.build.all
release.publish: release.publish.all
release.cleanup: release.cleanup.all
+4
View File
@@ -62,6 +62,10 @@ EOF
s3_upload $tmpdir/version
}
cleanup() {
:
}
action=$1
shift
+9
View File
@@ -65,6 +65,15 @@ publish() {
publish_artifact $os $arch rook/rookd
}
cleanup() {
local os=$1
local arch=$2
[[ ${os} == "linux" ]] || return 0
docker rmi ${registry}${tag} || true
}
publish_artifact() {
local os=$1
local arch=$2
+1 -1
View File
@@ -9,7 +9,7 @@ shift
mkdir -p ${RELEASE_DIR}
case ${action} in
build|publish)
build|publish|cleanup)
platform=$1
shift