simplify image push

This commit is contained in:
Dmitry Rozhkov 2019-08-29 16:28:37 +03:00
parent 0cda452c41
commit aadcc62dde
2 changed files with 7 additions and 10 deletions

3
Jenkinsfile vendored
View File

@ -140,8 +140,7 @@ pipeline {
script {
if (env.CHANGE_ID == null) {
withDockerRegistry([ credentialsId: "57e4a8b2-ccf9-4da1-a787-76dd1aac8fd1", url: "https://${REG}" ]) {
sh "make images PUSH=1"
sh "make demos PUSH=1"
sh "make push"
}
}
}

View File

@ -49,25 +49,23 @@ export TAG
images = $(shell ls build/docker/*.Dockerfile | sed 's/.*\/\(.\+\)\.Dockerfile/\1/')
$(images):
ifndef PUSH
@build/docker/build-image.sh $(REG)$@ $(BUILDER)
else
@docker push $(REG)$@
endif
images: $(images)
demos = $(shell cd demo/ && ls -d */ | sed 's/\(.\+\)\//\1/g')
$(demos):
ifndef PUSH
@cd demo/ && ./build-image.sh $(REG)$@ $(BUILDER)
else
@docker push ${REG}$@
endif
demos: $(demos)
image_tags = $(patsubst %,$(REG)%,$(images) $(demos))
$(image_tags):
@docker push $@
push: $(image_tags)
lock-images:
@scripts/update-clear-linux-base.sh clearlinux/golang:latest $(shell ls build/docker/*.Dockerfile)
@scripts/update-clear-linux-base.sh clearlinux:latest $(shell find demo -name Dockerfile)