Skip to content

Commit fb9ef11

Browse files
authored
align UI pipeline with operator (zalando#844)
* align UI pipeline with operator
1 parent b997e36 commit fb9ef11

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

delivery.yaml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff 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

ui/Makefile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ VERSION ?= $(shell git describe --tags --always --dirty)
55
TAG ?= $(VERSION)
66
GITHEAD = $(shell git rev-parse --short HEAD)
77
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')
99
TTYFLAGS = $(shell test -t 0 && echo '-it')
1010

11+
ifdef CDP_PULL_REQUEST_NUMBER
12+
CDP_TAG := -${CDP_BUILD_VERSION}
13+
endif
14+
1115
default: docker
1216

1317
clean:
@@ -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

3338
mock:
3439
docker run -it -p 8080:8080 "$(IMAGE):$(TAG)" --mock

0 commit comments

Comments
 (0)