File tree Expand file tree Collapse file tree 2 files changed +16
-18
lines changed Expand file tree Collapse file tree 2 files changed +16
-18
lines changed Original file line number Diff line number Diff line change @@ -66,20 +66,13 @@ pipeline:
6666 - desc : ' Build and push Docker image'
6767 cmd : |
6868 cd ui
69- image_base='registry-write.opensource.zalan.do/acid/postgres-operator-ui'
70- if [[ "${CDP_TARGET_BRANCH}" == 'master' && -z "${CDP_PULL_REQUEST_NUMBER}" ]]
71- then
72- image="${image_base}"
73- else
74- image="${image_base}-test"
75- fi
76- image_with_tag="${image}:c${CDP_BUILD_VERSION}"
77-
78- if docker pull "${image}"
69+ IS_PR_BUILD=${CDP_PULL_REQUEST_NUMBER+"true"}
70+ if [[ ${CDP_TARGET_BRANCH} == "master" && ${IS_PR_BUILD} != "true" ]]
7971 then
80- docker build --cache-from="${image}" -t "${image_with_tag}" .
72+ IMAGE=registry-write.opensource.zalan.do/acid/postgres-operator-ui
8173 else
82- docker build -t "${image_with_tag}" .
74+ IMAGE=registry-write.opensource.zalan.do/acid/postgres-operator-ui-test
8375 fi
84-
85- docker push "${image_with_tag}"
76+ export IMAGE
77+ make docker
78+ make push
Original file line number Diff line number Diff line change @@ -5,9 +5,13 @@ VERSION ?= $(shell git describe --tags --always --dirty)
55TAG ?= $(VERSION )
66GITHEAD = $(shell git rev-parse --short HEAD)
77GITURL = $(shell git config --get remote.origin.url)
8- GITSTATU = $(shell git status --porcelain || echo 'no changes')
8+ GITSTATUS = $(shell git status --porcelain || echo 'no changes')
99TTYFLAGS = $(shell test -t 0 && echo '-it')
1010
11+ ifdef CDP_PULL_REQUEST_NUMBER
12+ CDP_TAG := -${CDP_BUILD_VERSION}
13+ endif
14+
1115default : docker
1216
1317clean :
@@ -24,11 +28,12 @@ docker: appjs
2428 echo ` (env)`
2529 echo " Tag ${TAG} "
2630 echo " Version ${VERSION} "
31+ echo " CDP tag ${CDP_TAG} "
2732 echo " git describe $( shell git describe --tags --always --dirty) "
28- docker build --rm -t " $( IMAGE) :$( TAG) " -f Dockerfile .
33+ docker build --rm -t " $( IMAGE) :$( TAG) $( CDP_TAG ) " -f Dockerfile .
2934
30- push : docker
31- docker push " $( IMAGE) :$( TAG) "
35+ push :
36+ docker push " $( IMAGE) :$( TAG) $( CDP_TAG ) "
3237
3338mock :
3439 docker run -it -p 8080:8080 " $( IMAGE) :$( TAG) " --mock
You can’t perform that action at this time.
0 commit comments