Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions delivery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,13 @@ pipeline:
- desc: 'Build and push Docker image'
cmd: |
cd ui
image_base='registry-write.opensource.zalan.do/acid/postgres-operator-ui'
if [[ "${CDP_TARGET_BRANCH}" == 'master' && -z "${CDP_PULL_REQUEST_NUMBER}" ]]
then
image="${image_base}"
else
image="${image_base}-test"
fi
image_with_tag="${image}:c${CDP_BUILD_VERSION}"

if docker pull "${image}"
IS_PR_BUILD=${CDP_PULL_REQUEST_NUMBER+"true"}
if [[ ${CDP_TARGET_BRANCH} == "master" && ${IS_PR_BUILD} != "true" ]]
then
docker build --cache-from="${image}" -t "${image_with_tag}" .
IMAGE=registry-write.opensource.zalan.do/acid/postgres-operator-ui
else
docker build -t "${image_with_tag}" .
IMAGE=registry-write.opensource.zalan.do/acid/postgres-operator-ui-test
fi

docker push "${image_with_tag}"
export IMAGE
make docker
make push
13 changes: 9 additions & 4 deletions ui/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ VERSION ?= $(shell git describe --tags --always --dirty)
TAG ?= $(VERSION)
GITHEAD = $(shell git rev-parse --short HEAD)
GITURL = $(shell git config --get remote.origin.url)
GITSTATU = $(shell git status --porcelain || echo 'no changes')
GITSTATUS = $(shell git status --porcelain || echo 'no changes')
TTYFLAGS = $(shell test -t 0 && echo '-it')

ifdef CDP_PULL_REQUEST_NUMBER
CDP_TAG := -${CDP_BUILD_VERSION}
endif

default: docker

clean:
Expand All @@ -24,11 +28,12 @@ docker: appjs
echo `(env)`
echo "Tag ${TAG}"
echo "Version ${VERSION}"
echo "CDP tag ${CDP_TAG}"
echo "git describe $(shell git describe --tags --always --dirty)"
docker build --rm -t "$(IMAGE):$(TAG)" -f Dockerfile .
docker build --rm -t "$(IMAGE):$(TAG)$(CDP_TAG)" -f Dockerfile .

push: docker
docker push "$(IMAGE):$(TAG)"
push:
docker push "$(IMAGE):$(TAG)$(CDP_TAG)"

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