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:
66
66
- desc : ' Build and push Docker image'
67
67
cmd : |
68
68
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" ]]
79
71
then
80
- docker build --cache-from="${image}" -t "${image_with_tag}" .
72
+ IMAGE=registry-write.opensource.zalan.do/acid/postgres-operator-ui
81
73
else
82
- docker build -t "${image_with_tag}" .
74
+ IMAGE=registry-write.opensource.zalan.do/acid/postgres-operator-ui-test
83
75
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)
5
5
TAG ?= $(VERSION )
6
6
GITHEAD = $(shell git rev-parse --short HEAD)
7
7
GITURL = $(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')
9
9
TTYFLAGS = $(shell test -t 0 && echo '-it')
10
10
11
+ ifdef CDP_PULL_REQUEST_NUMBER
12
+ CDP_TAG := -${CDP_BUILD_VERSION}
13
+ endif
14
+
11
15
default : docker
12
16
13
17
clean :
@@ -24,11 +28,12 @@ docker: appjs
24
28
echo ` (env)`
25
29
echo " Tag ${TAG} "
26
30
echo " Version ${VERSION} "
31
+ echo " CDP tag ${CDP_TAG} "
27
32
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 .
29
34
30
- push : docker
31
- docker push " $( IMAGE) :$( TAG) "
35
+ push :
36
+ docker push " $( IMAGE) :$( TAG) $( CDP_TAG ) "
32
37
33
38
mock :
34
39
docker run -it -p 8080:8080 " $( IMAGE) :$( TAG) " --mock
You can’t perform that action at this time.
0 commit comments