WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit a27727f

Browse files
authored
[ui] internal pipeline fix to build ui image (#3013)
* fix ui pipeline * adjust logical backup image tagging
1 parent cd05682 commit a27727f

File tree

2 files changed

+89
-91
lines changed

2 files changed

+89
-91
lines changed

delivery.yaml

Lines changed: 89 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -7,92 +7,103 @@ build_env: &BUILD_ENV
77
MULTI_ARCH_REGISTRY: container-registry-test.zalando.net/acid
88

99
pipeline:
10-
- id: build-postgres-operator
11-
env:
12-
<<: *BUILD_ENV
13-
type: script
14-
vm_config:
15-
type: linux
16-
size: large
17-
image: cdp-runtime/go
18-
cache:
19-
paths:
20-
- /go/pkg/mod # pkg cache for Go modules
21-
- ~/.cache/go-build # Go build cache
22-
commands:
23-
- desc: Run unit tests
24-
cmd: |
25-
make deps mocks test
10+
- id: build-postgres-operator
11+
env:
12+
<<: *BUILD_ENV
13+
type: script
14+
vm_config:
15+
type: linux
16+
size: large
17+
image: cdp-runtime/go
18+
cache:
19+
paths:
20+
- /go/pkg/mod # pkg cache for Go modules
21+
- ~/.cache/go-build # Go build cache
22+
commands:
23+
- desc: Run unit tests
24+
cmd: |
25+
make deps mocks test
2626
27-
- desc: Build Docker image
28-
cmd: |
29-
if [ -z ${CDP_SOURCE_BRANCH} ]; then
30-
IMAGE=${MULTI_ARCH_REGISTRY}/postgres-operator
31-
else
32-
IMAGE=${MULTI_ARCH_REGISTRY}/postgres-operator-test
33-
fi
27+
- desc: Build Docker image
28+
cmd: |
29+
if [ -z ${CDP_SOURCE_BRANCH} ]; then
30+
IMAGE=${MULTI_ARCH_REGISTRY}/postgres-operator
31+
else
32+
IMAGE=${MULTI_ARCH_REGISTRY}/postgres-operator-test
33+
fi
3434
35-
docker buildx create --config /etc/cdp-buildkitd.toml --driver-opt network=host --bootstrap --use
36-
docker buildx build --platform "linux/amd64,linux/arm64" \
37-
--build-arg BASE_IMAGE="${ALPINE_BASE_IMAGE}" \
38-
-t "${IMAGE}:${CDP_BUILD_VERSION}" \
39-
-f docker/Dockerfile \
40-
--push .
35+
docker buildx create --config /etc/cdp-buildkitd.toml --driver-opt network=host --bootstrap --use
36+
docker buildx build --platform "linux/amd64,linux/arm64" \
37+
--build-arg BASE_IMAGE="${ALPINE_BASE_IMAGE}" \
38+
-t "${IMAGE}:${CDP_BUILD_VERSION}" \
39+
-f docker/Dockerfile \
40+
--push .
4141
42-
if [ -z ${CDP_SOURCE_BRANCH} ]; then
43-
cdp-promote-image ${IMAGE}:${CDP_BUILD_VERSION}
44-
fi
42+
if [ -z ${CDP_SOURCE_BRANCH} ]; then
43+
cdp-promote-image ${IMAGE}:${CDP_BUILD_VERSION}
44+
fi
4545
46-
- id: build-operator-ui
47-
env:
48-
<<: *BUILD_ENV
49-
type: script
50-
vm_config:
51-
type: linux
46+
- id: build-operator-ui
47+
env:
48+
<<: *BUILD_ENV
49+
type: script
50+
vm_config:
51+
type: linux
5252

53-
commands:
54-
- desc: 'Prepare environment'
55-
cmd: |
56-
apt-get update
57-
apt-get install -y build-essential
53+
commands:
54+
- desc: 'Prepare environment'
55+
cmd: |
56+
apt-get update
57+
apt-get install -y build-essential
5858
59-
- desc: 'Compile JavaScript app'
60-
cmd: |
61-
cd ui
62-
make appjs
59+
- desc: 'Compile JavaScript app'
60+
cmd: |
61+
cd ui
62+
make appjs
6363
64-
- desc: 'Build and push Docker image'
65-
cmd: |
66-
cd ui
67-
if [ -z ${CDP_SOURCE_BRANCH} ]; then
68-
IMAGE=${MULTI_ARCH_REGISTRY}/postgres-operator-ui
69-
else
70-
IMAGE=${MULTI_ARCH_REGISTRY}/postgres-operator-ui-test
71-
fi
72-
73-
IMAGE_TAG=$(make docker-push IMAGE=${IMAGE} BASE_IMAGE=${PYTHON_BASE_IMAGE})
64+
- desc: 'Build and push Docker image'
65+
cmd: |
66+
cd ui
67+
if [ -z ${CDP_SOURCE_BRANCH} ]; then
68+
IMAGE=${MULTI_ARCH_REGISTRY}/postgres-operator-ui
69+
else
70+
IMAGE=${MULTI_ARCH_REGISTRY}/postgres-operator-ui-test
71+
fi
72+
73+
make appjs
74+
docker buildx create --config /etc/cdp-buildkitd.toml --driver-opt network=host --bootstrap --use
75+
docker buildx build --platform linux/amd64,linux/arm64 \
76+
--build-arg BASE_IMAGE="${PYTHON_BASE_IMAGE}" \
77+
-t ${IMAGE}:${CDP_BUILD_VERSION} \
78+
--push .
7479
75-
if [ -z ${CDP_SOURCE_BRANCH} ]; then
76-
cdp-promote-image ${IMAGE_TAG}
77-
fi
80+
if [ -z ${CDP_SOURCE_BRANCH} ]; then
81+
cdp-promote-image ${IMAGE}:${CDP_BUILD_VERSION}
82+
fi
7883
79-
- id: build-logical-backup
80-
env:
81-
<<: *BUILD_ENV
82-
type: script
83-
vm_config:
84-
type: linux
84+
- id: build-logical-backup
85+
env:
86+
<<: *BUILD_ENV
87+
type: script
88+
vm_config:
89+
type: linux
8590

86-
commands:
87-
- desc: Build image
88-
cmd: |
89-
cd logical-backup
90-
export TAG=$(git describe --tags --always --dirty)
91-
docker buildx create --config /etc/cdp-buildkitd.toml --driver-opt network=host --bootstrap --use
92-
docker buildx build --platform linux/amd64,linux/arm64 \
93-
-t ${MULTI_ARCH_REGISTRY}/postgres-operator-logical-backup:${TAG} \
94-
--push .
91+
commands:
92+
- desc: Build image
93+
cmd: |
94+
cd logical-backup
9595
96-
if [ -z ${CDP_SOURCE_BRANCH} ]; then
97-
cdp-promote-image ${MULTI_ARCH_REGISTRY}/postgres-operator-logical-backup:${TAG}
98-
fi
96+
if [ -z ${CDP_SOURCE_BRANCH} ]; then
97+
IMAGE=${MULTI_ARCH_REGISTRY}/logical-backup
98+
else
99+
IMAGE=${MULTI_ARCH_REGISTRY}/logical-backup-test
100+
fi
101+
102+
docker buildx create --config /etc/cdp-buildkitd.toml --driver-opt network=host --bootstrap --use
103+
docker buildx build --platform linux/amd64,linux/arm64 \
104+
-t ${IMAGE}:${CDP_BUILD_VERSION} \
105+
--push .
106+
107+
if [ -z ${CDP_SOURCE_BRANCH} ]; then
108+
cdp-promote-image ${IMAGE}:${CDP_BUILD_VERSION}
109+
fi

ui/Makefile

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,5 @@ docker: appjs
3333
echo "git describe $(shell git describe --tags --always --dirty)"
3434
docker build --rm -t "$(IMAGE):$(TAG)$(CDP_TAG)" -f Dockerfile --build-arg BASE_IMAGE="${BASE_IMAGE}" .
3535

36-
docker-push: appjs
37-
echo "Tag ${TAG}"
38-
echo "Version ${VERSION}"
39-
echo "CDP tag ${CDP_TAG}"
40-
echo "git describe $(shell git describe --tags --always --dirty)"
41-
docker buildx create --config /etc/cdp-buildkitd.toml --driver-opt network=host --bootstrap --use
42-
docker buildx build --platform linux/amd64,linux/arm64 \
43-
--build-arg BASE_IMAGE="${BASE_IMAGE}" \
44-
-f Dockerfile \
45-
-t "$(IMAGE):$(TAG)$(CDP_TAG)" \
46-
--push .
47-
echo "$(IMAGE):$(TAG)$(CDP_TAG)"
48-
4936
mock:
5037
docker run -it -p 8081:8081 "$(IMAGE):$(TAG)" --mock

0 commit comments

Comments
 (0)