Skip to content

Commit d44451c

Browse files
authored
CR-16346 - support creating runtime+agent only in platform (#833)
## What added options to enable runtime+agent creation on platform only, without any changes to the cluster ## Why will be called during a helm installation. the cluster changes will be managed by helm ## Notes
1 parent 2c58bd8 commit d44451c

File tree

10 files changed

+605
-429
lines changed

10 files changed

+605
-429
lines changed

Dockerfile

+12-6
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,26 @@ ENV PATH="/pyinstaller:$PATH"
1010
RUN pip install yq==${YQ_VERSION}
1111
RUN pyinstaller --noconfirm --onefile --log-level DEBUG --clean --distpath /tmp/ $(which yq)
1212

13+
# kubectl binary
14+
FROM bitnami/kubectl:1.27.4 as kubectl
15+
1316
# Main
14-
FROM node:18.17.1-alpine3.17
17+
FROM node:18.17.1-alpine3.18
1518

16-
RUN apk --update add --no-cache ca-certificates git curl bash jq
19+
RUN apk --update add --no-cache \
20+
bash \
21+
ca-certificates \
22+
curl \
23+
git \
24+
jq
1725

1826
COPY --from=go /go/bin/hub /usr/local/bin/hub
1927
COPY --from=yq /tmp/yq /usr/local/bin/yq
28+
COPY --from=kubectl /opt/bitnami/kubectl/bin/kubectl /usr/local/bin/
2029

2130
WORKDIR /cf-cli
2231

23-
COPY package.json /cf-cli
24-
COPY yarn.lock /cf-cli
25-
COPY check-version.js /cf-cli
26-
COPY run-check-version.js /cf-cli
32+
COPY package.json yarn.lock check-version.js run-check-version.js /cf-cli/
2733

2834
RUN yarn install --prod --frozen-lockfile && \
2935
yarn cache clean

Dockerfile-debian

+15-6
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,30 @@ ENV PATH="/pyinstaller:$PATH"
1010
RUN pip install yq==${YQ_VERSION}
1111
RUN pyinstaller --noconfirm --onefile --log-level DEBUG --clean --distpath /tmp/ $(which yq)
1212

13+
# kubectl binary
14+
FROM bitnami/kubectl:1.27.4 as kubectl
15+
1316
# Main
1417
FROM node:18.17.1-bullseye-slim
1518

16-
RUN apt update
17-
RUN apt -y install ca-certificates git curl bash jq busybox && ln -s /bin/busybox /usr/bin/[[
19+
RUN apt update \
20+
&& apt -y install \
21+
apt-transport-https \
22+
bash \
23+
busybox \
24+
ca-certificates \
25+
curl \
26+
git \
27+
jq \
28+
&& ln -s /bin/busybox /usr/bin/[[
1829

1930
COPY --from=go /go/bin/hub /usr/local/bin/hub
2031
COPY --from=yq /tmp/yq /usr/local/bin/yq
32+
COPY --from=kubectl /opt/bitnami/kubectl/bin/kubectl /usr/local/bin/
2133

2234
WORKDIR /cf-cli
2335

24-
COPY package.json /cf-cli
25-
COPY yarn.lock /cf-cli
26-
COPY check-version.js /cf-cli
27-
COPY run-check-version.js /cf-cli
36+
COPY package.json yarn.lock check-version.js run-check-version.js /cf-cli/
2837

2938
RUN yarn install --prod --frozen-lockfile && \
3039
yarn cache clean

Dockerfile-debian-rootless

+15-7
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,29 @@ ENV PATH="/pyinstaller:$PATH"
1010
RUN pip install yq==${YQ_VERSION}
1111
RUN pyinstaller --noconfirm --onefile --log-level DEBUG --clean --distpath /tmp/ $(which yq)
1212

13+
# kubectl binary
14+
FROM bitnami/kubectl:1.27.4 as kubectl
15+
1316
# Main
1417
FROM node:18.17.1-bullseye-slim
1518

16-
RUN apt update
17-
RUN apt -y install ca-certificates git curl bash jq busybox && ln -s /bin/busybox /usr/bin/[[
19+
RUN apt update \
20+
&& apt -y install \
21+
bash \
22+
busybox \
23+
ca-certificates \
24+
curl \
25+
git \
26+
jq \
27+
&& ln -s /bin/busybox /usr/bin/[[
1828

1929
COPY --from=go /go/bin/hub /usr/local/bin/hub
2030
COPY --from=yq /tmp/yq /usr/local/bin/yq
31+
COPY --from=kubectl /opt/bitnami/kubectl/bin/kubectl /usr/local/bin/
2132

2233
WORKDIR /cf-cli
2334

24-
COPY package.json /cf-cli
25-
COPY yarn.lock /cf-cli
26-
COPY check-version.js /cf-cli
27-
COPY run-check-version.js /cf-cli
35+
COPY package.json yarn.lock check-version.js run-check-version.js /cf-cli/
2836

2937
RUN yarn install --prod --frozen-lockfile && \
3038
yarn cache clean
@@ -38,7 +46,7 @@ RUN ln -s $(pwd)/lib/interface/cli/codefresh /usr/local/bin/codefresh
3846
RUN codefresh components update --location components
3947

4048
# we keep /root as home directory because cli by default looks for $HOME/.cfconfig
41-
# and we do not want to break user automation if he used to bind his .cfconfig
49+
# and we do not want to break user automation if they used to bind their .cfconfig
4250
# to the /root/.cfconfig
4351
RUN useradd -m -d /root -s /bin/sh cfu \
4452
&& chown -R $(id -g cfu) /root /cf-cli \

Dockerfile-rootless

+13-7
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,26 @@ ENV PATH="/pyinstaller:$PATH"
1010
RUN pip install yq==${YQ_VERSION}
1111
RUN pyinstaller --noconfirm --onefile --log-level DEBUG --clean --distpath /tmp/ $(which yq)
1212

13+
# kubectl binary
14+
FROM bitnami/kubectl:1.27.4 as kubectl
15+
1316
# Main
14-
FROM node:18.17.1-alpine3.17
17+
FROM node:18.17.1-alpine3.18
1518

16-
RUN apk --update add --no-cache ca-certificates git curl bash jq
19+
RUN apk --update add --no-cache \
20+
bash \
21+
ca-certificates \
22+
curl \
23+
git \
24+
jq
1725

1826
COPY --from=go /go/bin/hub /usr/local/bin/hub
1927
COPY --from=yq /tmp/yq /usr/local/bin/yq
28+
COPY --from=kubectl /opt/bitnami/kubectl/bin/kubectl /usr/local/bin/
2029

2130
WORKDIR /cf-cli
2231

23-
COPY package.json /cf-cli
24-
COPY yarn.lock /cf-cli
25-
COPY check-version.js /cf-cli
26-
COPY run-check-version.js /cf-cli
32+
COPY package.json yarn.lock check-version.js run-check-version.js /cf-cli/
2733

2834
RUN yarn install --prod --frozen-lockfile && \
2935
yarn cache clean
@@ -37,7 +43,7 @@ RUN ln -s $(pwd)/lib/interface/cli/codefresh /usr/local/bin/codefresh
3743
RUN codefresh components update --location components
3844

3945
# we keep /root as home directory because cli by default looks for $HOME/.cfconfig
40-
# and we do not want to break user automation if he used to bind his .cfconfig
46+
# and we do not want to break user automation if they used to bind their .cfconfig
4147
# to the /root/.cfconfig
4248
RUN adduser -D -h /root -s /bin/sh cfu \
4349
&& chown -R $(id -g cfu) /root /cf-cli \

codefresh-arm.yml

+16-8
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ steps:
2626
disable_push: true
2727
dockerfile: ./Dockerfile
2828
image_name: ${{IMAGE_NAME}}
29-
tag: ${{CF_SHORT_REVISION}}
29+
tag: ${{CF_BRANCH_TAG_NORMALIZED}}
3030

3131
build_image_debian:
3232
title: "Building the debian image..."
@@ -35,7 +35,7 @@ steps:
3535
disable_push: true
3636
dockerfile: ./Dockerfile-debian
3737
image_name: ${{IMAGE_NAME}}
38-
tag: ${{CF_SHORT_REVISION}}${{DEBIAN_TAG_POSTFIX}}
38+
tag: ${{CF_BRANCH_TAG_NORMALIZED}}${{DEBIAN_TAG_POSTFIX}}
3939

4040
build_image_alpine_rootless:
4141
title: "Building the alpine image..."
@@ -44,7 +44,7 @@ steps:
4444
disable_push: true
4545
dockerfile: ./Dockerfile-rootless
4646
image_name: ${{IMAGE_NAME}}
47-
tag: ${{CF_SHORT_REVISION}}${{ROOTLESS_TAG_POSTFIX}}
47+
tag: ${{CF_BRANCH_TAG_NORMALIZED}}${{ROOTLESS_TAG_POSTFIX}}
4848

4949
build_image_debian_rootless:
5050
title: "Building the debian image..."
@@ -53,7 +53,7 @@ steps:
5353
disable_push: true
5454
dockerfile: ./Dockerfile-debian-rootless
5555
image_name: ${{IMAGE_NAME}}
56-
tag: ${{CF_SHORT_REVISION}}${{DEBIAN_TAG_POSTFIX}}${{ROOTLESS_TAG_POSTFIX}}
56+
tag: ${{CF_BRANCH_TAG_NORMALIZED}}${{DEBIAN_TAG_POSTFIX}}${{ROOTLESS_TAG_POSTFIX}}
5757
when:
5858
steps:
5959
- name: main_clone
@@ -65,7 +65,9 @@ steps:
6565
type: push
6666
candidate: ${{build_image_alpine}}
6767
title: "Pushing alpine image to registry with revision tag"
68-
tag: ${{CF_SHORT_REVISION}}${{ARM_TAG_POSTFIX}}
68+
tags:
69+
- ${{CF_BRANCH_TAG_NORMALIZED}}${{ARM_TAG_POSTFIX}}
70+
- ${{CF_BRANCH_TAG_NORMALIZED}}${{ARM_TAG_POSTFIX}}-${{CF_SHORT_REVISION}}
6971
scale:
7072
push_quay_dev:
7173
registry: "${{REGISTRY_INTEGRATION_QUAY}}"
@@ -87,7 +89,9 @@ steps:
8789
type: push
8890
candidate: ${{build_image_debian}}
8991
title: "Pushing debian image to registry with revision tag"
90-
tag: ${{CF_SHORT_REVISION}}${{DEBIAN_TAG_POSTFIX}}${{ARM_TAG_POSTFIX}}
92+
tags:
93+
- ${{CF_BRANCH_TAG_NORMALIZED}}${{DEBIAN_TAG_POSTFIX}}${{ARM_TAG_POSTFIX}}
94+
- ${{CF_BRANCH_TAG_NORMALIZED}}${{DEBIAN_TAG_POSTFIX}}${{ARM_TAG_POSTFIX}}-${{CF_SHORT_REVISION}}
9195
scale:
9296
push_quay_dev_debian:
9397
registry: "${{REGISTRY_INTEGRATION_QUAY}}"
@@ -109,7 +113,9 @@ steps:
109113
type: push
110114
candidate: ${{build_image_alpine_rootless}}
111115
title: "Pushing rootless alpine image to registry with revision tag"
112-
tag: ${{CF_SHORT_REVISION}}${{ROOTLESS_TAG_POSTFIX}}${{ARM_TAG_POSTFIX}}
116+
tags:
117+
- ${{CF_BRANCH_TAG_NORMALIZED}}${{ROOTLESS_TAG_POSTFIX}}${{ARM_TAG_POSTFIX}}
118+
- ${{CF_BRANCH_TAG_NORMALIZED}}${{ROOTLESS_TAG_POSTFIX}}${{ARM_TAG_POSTFIX}}-${{CF_SHORT_REVISION}}
113119
scale:
114120
push_quay_dev_rootless:
115121
registry: "${{REGISTRY_INTEGRATION_QUAY}}"
@@ -131,7 +137,9 @@ steps:
131137
type: push
132138
candidate: ${{build_image_debian_rootless}}
133139
title: "Pushing rootless debian image to registry with revision tag"
134-
tag: ${{CF_SHORT_REVISION}}${{DEBIAN_TAG_POSTFIX}}${{ROOTLESS_TAG_POSTFIX}}${{ARM_TAG_POSTFIX}}
140+
tags:
141+
- ${{CF_BRANCH_TAG_NORMALIZED}}${{DEBIAN_TAG_POSTFIX}}${{ROOTLESS_TAG_POSTFIX}}${{ARM_TAG_POSTFIX}}
142+
- ${{CF_BRANCH_TAG_NORMALIZED}}${{DEBIAN_TAG_POSTFIX}}${{ROOTLESS_TAG_POSTFIX}}${{ARM_TAG_POSTFIX}}-${{CF_SHORT_REVISION}}
135143
scale:
136144
push_quay_dev_debian_rootless:
137145
registry: "${{REGISTRY_INTEGRATION_QUAY}}"

codefresh.yml

+21-9
Original file line numberDiff line numberDiff line change
@@ -111,24 +111,28 @@ steps:
111111
type: build
112112
dockerfile: Dockerfile
113113
image-name: codefresh/cli
114+
disable_push: true
114115
tag: ${{CF_BRANCH_TAG_NORMALIZED}}
115116

116117
build_step_debian:
117118
type: build
118119
dockerfile: Dockerfile-debian
119120
image-name: codefresh/cli
121+
disable_push: true
120122
tag: ${{CF_BRANCH_TAG_NORMALIZED}}${{DEBIAN_TAG_POSTFIX}}
121123

122124
build_step_alpine_rootless:
123125
type: build
124126
dockerfile: Dockerfile-rootless
125127
image-name: codefresh/cli
128+
disable_push: true
126129
tag: ${{CF_BRANCH_TAG_NORMALIZED}}${{ROOTLESS_TAG_POSTFIX}}
127130

128131
build_step_debian_rootless:
129132
type: build
130133
dockerfile: Dockerfile-debian-rootless
131134
image-name: codefresh/cli
135+
disable_push: true
132136
tag: ${{CF_BRANCH_TAG_NORMALIZED}}${{DEBIAN_TAG_POSTFIX}}${{ROOTLESS_TAG_POSTFIX}}
133137
when:
134138
steps:
@@ -166,7 +170,9 @@ steps:
166170
push_step_alpine:
167171
stage: push
168172
type: push
169-
tag: '${{CF_SHORT_REVISION}}'
173+
tags:
174+
- ${{CF_BRANCH_TAG_NORMALIZED}}
175+
- ${{CF_BRANCH_TAG_NORMALIZED}}-${{CF_SHORT_REVISION}}
170176
candidate: ${{build_step_alpine}}
171177
scale:
172178
push_to_dockerhub:
@@ -186,7 +192,9 @@ steps:
186192
push_step_debian:
187193
stage: push
188194
type: push
189-
tag: '${{CF_SHORT_REVISION}}${{DEBIAN_TAG_POSTFIX}}'
195+
tags:
196+
- ${{CF_BRANCH_TAG_NORMALIZED}}${{DEBIAN_TAG_POSTFIX}}
197+
- ${{CF_BRANCH_TAG_NORMALIZED}}${{DEBIAN_TAG_POSTFIX}}-${{CF_SHORT_REVISION}}
190198
candidate: ${{build_step_debian}}
191199
scale:
192200
push_to_dockerhub_debian:
@@ -206,7 +214,9 @@ steps:
206214
push_step_alpine_rootless:
207215
stage: push
208216
type: push
209-
tag: '${{CF_SHORT_REVISION}}${{ROOTLESS_TAG_POSTFIX}}'
217+
tags:
218+
- ${{CF_BRANCH_TAG_NORMALIZED}}${{ROOTLESS_TAG_POSTFIX}}
219+
- ${{CF_BRANCH_TAG_NORMALIZED}}${{ROOTLESS_TAG_POSTFIX}}-${{CF_SHORT_REVISION}}
210220
candidate: ${{build_step_alpine_rootless}}
211221
scale:
212222
push_to_dockerhub_rootless:
@@ -226,7 +236,9 @@ steps:
226236
push_step_debian_rootless:
227237
stage: push
228238
type: push
229-
tag: '${{CF_SHORT_REVISION}}${{DEBIAN_TAG_POSTFIX}}${{ROOTLESS_TAG_POSTFIX}}'
239+
tags:
240+
- ${{CF_BRANCH_TAG_NORMALIZED}}${{DEBIAN_TAG_POSTFIX}}${{ROOTLESS_TAG_POSTFIX}}
241+
- ${{CF_BRANCH_TAG_NORMALIZED}}${{DEBIAN_TAG_POSTFIX}}${{ROOTLESS_TAG_POSTFIX}}-${{CF_SHORT_REVISION}}
230242
candidate: ${{build_step_debian_rootless}}
231243
scale:
232244
push_to_dockerhub_debian_rootless:
@@ -268,28 +280,28 @@ steps:
268280
ignore: [ master ]
269281
arguments:
270282
tags:
271-
- ${{CF_SHORT_REVISION}}
283+
- ${{CF_BRANCH_TAG_NORMALIZED}}
272284
dev_branches_tags_debian:
273285
when:
274286
branch:
275287
ignore: [ master ]
276288
arguments:
277289
tags:
278-
- ${{CF_SHORT_REVISION}}${{DEBIAN_TAG_POSTFIX}}
290+
- ${{CF_BRANCH_TAG_NORMALIZED}}${{DEBIAN_TAG_POSTFIX}}
279291
dev_branches_tags_rootless:
280292
when:
281293
branch:
282294
ignore: [ master ]
283295
arguments:
284296
tags:
285-
- ${{CF_SHORT_REVISION}}${{ROOTLESS_TAG_POSTFIX}}
297+
- ${{CF_BRANCH_TAG_NORMALIZED}}${{ROOTLESS_TAG_POSTFIX}}
286298
dev_branches_tags_debian_rootless:
287299
when:
288300
branch:
289301
ignore: [ master ]
290302
arguments:
291303
tags:
292-
- ${{CF_SHORT_REVISION}}${{DEBIAN_TAG_POSTFIX}}${{ROOTLESS_TAG_POSTFIX}}
304+
- ${{CF_BRANCH_TAG_NORMALIZED}}${{DEBIAN_TAG_POSTFIX}}${{ROOTLESS_TAG_POSTFIX}}
293305
when:
294306
steps:
295307
- name: push_step_alpine
@@ -350,7 +362,7 @@ steps:
350362
arguments:
351363
PIPELINE_ID: 'cli-v1-e2e/root'
352364
VARIABLE:
353-
- CLI_VERSION=${{CF_SHORT_REVISION}}
365+
- CLI_VERSION=${{CF_BRANCH_TAG_NORMALIZED}}-${{CF_SHORT_REVISION}}
354366
when:
355367
steps:
356368
- name: push_step_alpine

0 commit comments

Comments
 (0)