Skip to content

Commit 89b33ae

Browse files
authored
Add ARM support (#608)
* Update Dockerfile * Added arm build * Fix stage * Fix pipeline run step * Added manifests to pipeline * Fix push step * Updated gcr creds * Added test step * Added test step * Removed test step * Added test step * Removed test step * Override gcr registry * Update release pipeline * Bump version * Added codefresh-arm.yml * Update pipelines * Update trigger name * Added titles
1 parent 8e1543f commit 89b33ae

File tree

5 files changed

+171
-34
lines changed

5 files changed

+171
-34
lines changed

Dockerfile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,13 @@ RUN pip install yq==${YQ_VERSION}
1111
RUN pyinstaller --noconfirm --onefile --log-level DEBUG --clean --distpath /tmp/ $(which yq)
1212

1313
# Main
14-
FROM codefresh/node:10.15.3-alpine3.11
14+
FROM node:10.23.0-alpine3.11
1515

16-
RUN apk --update add --no-cache ca-certificates git curl bash yarn
16+
RUN apk --update add --no-cache ca-certificates git curl bash yarn jq=1.6-r0
1717

1818
COPY --from=go /go/bin/hub /usr/local/bin/hub
1919
COPY --from=yq /tmp/yq /usr/local/bin/yq
2020

21-
ARG JQ_VERSION=1.6
22-
23-
RUN wget -O /usr/local/bin/jq https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-linux64 && \
24-
chmod +x /usr/local/bin/*
25-
2621
WORKDIR /cf-cli
2722

2823
COPY package.json /cf-cli

codefresh-arm.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
version: "1.0"
2+
steps:
3+
main_clone:
4+
title: 'Cloning main repository...'
5+
type: git-clone
6+
repo: ${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}
7+
revision: ${{CF_REVISION}}
8+
git: ${{GIT_CONTEXT}}
9+
10+
build_image:
11+
title: "Building the image..."
12+
type: build
13+
working_directory: ${{WORKDIR}}
14+
disable_push: true
15+
dockerfile: ./Dockerfile
16+
image_name: ${{IMAGE_NAME}}
17+
tag: ${{CF_SHORT_REVISION}}
18+
19+
push_dev:
20+
type: push
21+
candidate: ${{build_image}}
22+
title: "Pushing image to registry with revision tag"
23+
tag: ${{CF_SHORT_REVISION}}${{ARM_TAG_POSTFIX}}
24+
scale:
25+
push_quay_dev:
26+
registry: "${{REGISTRY_INTEGRATION_QUAY}}"
27+
title: "Pushing image to quay.io registry with revision tag"
28+
push_dockerhub_dev:
29+
registry: "${{REGISTRY_INTEGRATION_DOCKERHUB}}"
30+
title: "Pushing image to dockerhub registry with revision tag"
31+
push_gcr_enterprise_dev:
32+
registry: "${{REGISTRY_INTEGRATION_ENTERPRISE}}"
33+
title: "Pushing image to gcr.io registry with revision tag"
34+
35+
push_master:
36+
type: push
37+
candidate: ${{build_image}}
38+
title: "Pushing image with release tag"
39+
when:
40+
branch:
41+
only: [ master ]
42+
tags:
43+
- "${{PACKAGE_VERSION}}${{ARM_TAG_POSTFIX}}"
44+
- "latest${{ARM_TAG_POSTFIX}}"
45+
scale:
46+
push_quay_prod:
47+
registry: "${{REGISTRY_INTEGRATION_QUAY}}"
48+
title: "Pushing image to quay.io registry with release tag"
49+
push_dockerhub_prod:
50+
registry: "${{REGISTRY_INTEGRATION_DOCKERHUB}}"
51+
title: "Pushing image to dockerhub registry with release tag"
52+
push_gcr_enterprise_prod:
53+
registry: "${{REGISTRY_INTEGRATION_ENTERPRISE}}"
54+
title: "Pushing image to gcr.io registry with release tag"

codefresh-release.yml

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,48 @@ steps:
2929
- "cf_export PACKAGE_VERSION"
3030

3131
# in case the candidate image will not be found the release flow will crash and this means that the build pipelines has failed
32-
push_to_registry_version:
33-
title: "Update dockerhub image version tag"
32+
push_step:
3433
type: push
35-
candidate: gcr.io/codefresh-inc/codefresh/cli:${{CF_SHORT_REVISION}}
36-
image_name: codefresh/cli
37-
tag: ${{PACKAGE_VERSION}}
38-
registry: dockerhub
34+
title: "Push release image"
35+
tags:
36+
- ${{PACKAGE_VERSION}}
37+
- latest
38+
scale:
39+
push_to_dockerhub:
40+
registry: dockerhub
41+
title: "push to dockerhub"
42+
candidate: codefresh/cli:${{CF_SHORT_REVISION}}
43+
push_to_gcr:
44+
title: "push to gcr"
45+
candidate: gcr.io/codefresh-inc/codefresh/cli:${{CF_SHORT_REVISION}}
46+
push_to_quay:
47+
registry: cf-quay
48+
title: "push to quay.io"
49+
candidate: quay.io/codefresh/codefresh/cli:${{CF_SHORT_REVISION}}
3950

40-
push_to_registry_latest:
41-
title: "Update dockerhub image latest tag"
42-
type: push
43-
candidate: gcr.io/codefresh-inc/codefresh/cli:${{CF_SHORT_REVISION}}
44-
image_name: codefresh/cli
45-
tag: latest
46-
registry: dockerhub
51+
create_manifest_list:
52+
type: "codefresh-inc/multiarch-manifester"
53+
arguments:
54+
image_name: codefresh/cli
55+
arch_tag_postfixes:
56+
arm64: "${{ARM_TAG_POSTFIX}}"
57+
registries:
58+
- name: 'quay.io'
59+
username: '${{QUAY_USERNAME}}'
60+
password: '${{QUAY_PASSWORD}}'
61+
- name: 'docker.io'
62+
username: '${{DOCKERHUB_USERNAME}}'
63+
password: '${{DOCKERHUB_PASSWORD}}'
64+
- name: 'gcr.io'
65+
path_prefix: codefresh-inc
66+
username: '${{GCR_CODEFRESH_INC_USERNAME}}'
67+
password: '${{GCR_CODEFRESH_INC_PASSWORD}}'
68+
scale:
69+
master_branch_tags:
70+
arguments:
71+
tags:
72+
- ${{PACKAGE_VERSION}}
73+
- latest
4774

4875
generate_comletion:
4976
title: "Generating commands completion tree"

codefresh.yml

Lines changed: 74 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,42 @@ steps:
2828
commands:
2929
- yarn test
3030

31-
build_step:
32-
type: build
33-
dockerfile: Dockerfile
34-
image-name: codefresh/cli
35-
tag: ${{CF_BRANCH_TAG_NORMALIZED}}
31+
extract_version:
32+
title: "Exporting package.json version"
33+
image: codefresh/build-cli
34+
commands:
35+
- 'export PACKAGE_VERSION=$(jq -r ".version" package.json)'
36+
- "echo Current version: $PACKAGE_VERSION"
37+
- "cf_export PACKAGE_VERSION"
38+
39+
build_images:
40+
type: parallel
41+
steps:
42+
43+
build_step:
44+
type: build
45+
dockerfile: Dockerfile
46+
image-name: codefresh/cli
47+
tag: ${{CF_BRANCH_TAG_NORMALIZED}}
48+
49+
run_arm_build:
50+
type: codefresh-run
51+
arguments:
52+
PIPELINE_ID: 'codefresh-io/cli/build-arm'
53+
TRIGGER_ID: codefresh-io/cli
54+
BRANCH: ${{CF_BRANCH}}
55+
DETACH: false
56+
VARIABLE:
57+
- CF_REPO_OWNER=${{CF_REPO_OWNER}}
58+
- CF_REPO_NAME=${{CF_REPO_NAME}}
59+
- CF_REVISION=${{CF_REVISION}}
60+
- CF_BRANCH=${{CF_BRANCH}}
61+
- CF_SHORT_REVISION=${{CF_SHORT_REVISION}}
62+
- GIT_CONTEXT=cf_github
63+
- IMAGE_NAME=codefresh/cli
64+
- WORKDIR=${{CF_VOLUME_PATH}}/${{CF_REPO_NAME}}
65+
- ARM_TAG_POSTFIX="${{ARM_TAG_POSTFIX}}"
66+
- PACKAGE_VERSION=${{PACKAGE_VERSION}}
3667

3768
push_step:
3869
type: push
@@ -41,19 +72,49 @@ steps:
4172
scale:
4273
push_to_dockerhub:
4374
registry: dockerhub
44-
title: "push to dockerhub"
75+
title: "push to dockerhub"
4576
push_to_gcr:
46-
title: "push to gcr"
77+
title: "push to gcr"
78+
push_to_quay:
79+
registry: cf-quay
80+
title: "push to quay.io"
81+
82+
create_manifest_list:
83+
type: "codefresh-inc/multiarch-manifester"
84+
arguments:
85+
image_name: codefresh/cli
86+
arch_tag_postfixes:
87+
arm64: "${{ARM_TAG_POSTFIX}}"
88+
registries:
89+
- name: 'quay.io'
90+
username: '${{QUAY_USERNAME}}'
91+
password: '${{QUAY_PASSWORD}}'
92+
- name: 'docker.io'
93+
username: '${{DOCKERHUB_USERNAME}}'
94+
password: '${{DOCKERHUB_PASSWORD}}'
95+
- name: 'gcr.io'
96+
path_prefix: codefresh-inc
97+
username: '${{GCR_CODEFRESH_INC_USERNAME}}'
98+
password: '${{GCR_CODEFRESH_INC_PASSWORD}}'
99+
scale:
100+
dev_branches_tags:
101+
when:
102+
branch:
103+
ignore: [ master ]
104+
arguments:
105+
tags:
106+
- ${{CF_SHORT_REVISION}}
47107

48108
execute_release_pipeline:
49109
title: "Execute release pipeline in case version was changed"
50110
fail_fast: false
51-
image: codefresh/cli
52-
commands:
53-
- 'apk update && apk add jq'
54-
- 'export PACKAGE_VERSION=$(jq -r ".version" package.json)'
55-
- "echo Current version: $PACKAGE_VERSION"
56-
- "git tag $PACKAGE_VERSION && echo Running release pipeline && codefresh run 5a4c94d282ed4d00012b54e8 -b=master --detach"
111+
type: codefresh-run
112+
arguments:
113+
PIPELINE_ID: 'codefresh-io/cli/release'
114+
DETACH: true
115+
BRANCH: master
116+
VARIABLE:
117+
- PACKAGE_VERSION=${{PACKAGE_VERSION}}
57118
when:
58119
branch:
59120
only: [ master ]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codefresh",
3-
"version": "0.73.30",
3+
"version": "0.73.31",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,

0 commit comments

Comments
 (0)