Skip to content

Commit 534e6f3

Browse files
committed
add cli-stack for binary distribution
Signed-off-by: Sachin Sampras M <sampras343@gmail.com>
1 parent b409e59 commit 534e6f3

4 files changed

Lines changed: 172 additions & 0 deletions

File tree

.tekton/cli-v08-push.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ apiVersion: tekton.dev/v1
22
kind: PipelineRun
33
metadata:
44
annotations:
5+
build.appstudio.openshift.io/build-nudge-files: "Dockerfile.cli-stack.rh"
56
build.appstudio.openshift.io/repo: https://github.com/conforma/cli?rev={{revision}}
67
build.appstudio.redhat.com/commit_sha: '{{revision}}'
78
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
apiVersion: tekton.dev/v1
2+
kind: PipelineRun
3+
metadata:
4+
annotations:
5+
build.appstudio.openshift.io/repo: https://github.com/conforma/cli?rev={{revision}}
6+
build.appstudio.redhat.com/commit_sha: '{{revision}}'
7+
build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}'
8+
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
9+
pipelinesascode.tekton.dev/max-keep-runs: "3"
10+
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
11+
== "release-v0.8"
12+
creationTimestamp: null
13+
labels:
14+
appstudio.openshift.io/application: cli-stacks
15+
appstudio.openshift.io/component: conforma-cli-stack
16+
pipelines.appstudio.openshift.io/type: build
17+
name: conforma-cli-stack-on-pull-request
18+
namespace: rhtas-tenant
19+
spec:
20+
params:
21+
- name: release-version
22+
value: 1.4.0
23+
- name: dockerfile
24+
value: Dockerfile.cli-stack.rh
25+
- name: git-url
26+
value: '{{repo_url}}'
27+
- name: image-expires-after
28+
value: 5d
29+
- name: output-image
30+
value: quay.io/securesign/conforma-cli-stack:on-pr-{{revision}}
31+
- name: path-context
32+
value: .
33+
- name: revision
34+
value: '{{revision}}'
35+
- name: hermetic
36+
value: "true"
37+
- name: build-source-image
38+
value: "true"
39+
pipelineRef:
40+
params:
41+
- name: url
42+
value: https://github.com/securesign/pipelines.git
43+
- name: revision
44+
value: main
45+
- name: pathInRepo
46+
value: pipelines/docker-build-oci-ta.yaml
47+
resolver: git
48+
taskRunTemplate:
49+
serviceAccountName: build-pipeline-conforma-cli-stack
50+
workspaces:
51+
- name: git-auth
52+
secret:
53+
secretName: '{{ git_auth_secret }}'
54+
status: {}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
apiVersion: tekton.dev/v1
2+
kind: PipelineRun
3+
metadata:
4+
annotations:
5+
build.appstudio.openshift.io/repo: https://github.com/conforma/cli?rev={{revision}}
6+
build.appstudio.redhat.com/commit_sha: '{{revision}}'
7+
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
8+
pipelinesascode.tekton.dev/max-keep-runs: "3"
9+
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
10+
== "release-v0.8"
11+
creationTimestamp: null
12+
labels:
13+
appstudio.openshift.io/application: cli-stacks
14+
appstudio.openshift.io/component: conforma-cli-stack
15+
pipelines.appstudio.openshift.io/type: build
16+
name: conforma-cli-stack-on-push
17+
namespace: rhtas-tenant
18+
spec:
19+
params:
20+
- name: release-version
21+
value: 1.4.0
22+
- name: dockerfile
23+
value: Dockerfile.cli-stack.rh
24+
- name: git-url
25+
value: '{{repo_url}}'
26+
- name: output-image
27+
value: quay.io/securesign/conforma-cli-stack:{{revision}}
28+
- name: path-context
29+
value: .
30+
- name: revision
31+
value: '{{revision}}'
32+
- name: hermetic
33+
value: "true"
34+
- name: build-source-image
35+
value: "true"
36+
pipelineRef:
37+
params:
38+
- name: url
39+
value: https://github.com/securesign/pipelines.git
40+
- name: revision
41+
value: main
42+
- name: pathInRepo
43+
value: pipelines/docker-build-oci-ta.yaml
44+
resolver: git
45+
taskRunTemplate:
46+
serviceAccountName: build-pipeline-conforma-cli-stack
47+
workspaces:
48+
- name: git-auth
49+
secret:
50+
secretName: '{{ git_auth_secret }}'
51+
status: {}

Dockerfile.cli-stack.rh

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
FROM --platform=linux/amd64 quay.io/redhat-user-workloads/rhtap-contract-tenant/ec-v08/cli-v08@sha256:7d2ecffad4cee873caee676eda74c5acd6254e64bbca8280b1d69f0806426999 AS build-amd64
2+
FROM --platform=linux/arm64 quay.io/redhat-user-workloads/rhtap-contract-tenant/ec-v08/cli-v08@sha256:9f39e82fd59f414bc26207d18588c5ffbf8c9c0ca00e81e68f80f2c39db01657 AS build-arm64
3+
FROM --platform=linux/ppc64le quay.io/redhat-user-workloads/rhtap-contract-tenant/ec-v08/cli-v08@sha256:2e385572d9cc508288e5a4cc7a44c22de4266be860e725a7795d4402db1314c0 AS build-ppc64le
4+
FROM --platform=linux/s390x quay.io/redhat-user-workloads/rhtap-contract-tenant/ec-v08/cli-v08@sha256:e725abfa91aa21d28d2ae5b5c5fa5544bcd3998b48c18d268d981c1ad51d3f1f AS build-s390x
5+
6+
FROM registry.redhat.io/ubi9/go-toolset:9.7@sha256:799cc027d5ad58cdc156b65286eb6389993ec14c496cf748c09834b7251e78dc AS packager
7+
USER root
8+
RUN mkdir -p /binaries
9+
10+
# Native Linux binaries from each arch variant
11+
COPY --from=build-amd64 /usr/local/bin/ec_linux_amd64.gz /tmp/ec_linux_amd64.gz
12+
RUN gzip -d /tmp/ec_linux_amd64.gz && \
13+
tar -czf /binaries/ec_linux_amd64.tar.gz -C /tmp ec_linux_amd64 && \
14+
rm /tmp/ec_linux_amd64
15+
16+
COPY --from=build-arm64 /usr/local/bin/ec_linux_arm64.gz /tmp/ec_linux_arm64.gz
17+
RUN gzip -d /tmp/ec_linux_arm64.gz && \
18+
tar -czf /binaries/ec_linux_arm64.tar.gz -C /tmp ec_linux_arm64 && \
19+
rm /tmp/ec_linux_arm64
20+
21+
COPY --from=build-ppc64le /usr/local/bin/ec_linux_ppc64le.gz /tmp/ec_linux_ppc64le.gz
22+
RUN gzip -d /tmp/ec_linux_ppc64le.gz && \
23+
tar -czf /binaries/ec_linux_ppc64le.tar.gz -C /tmp ec_linux_ppc64le && \
24+
rm /tmp/ec_linux_ppc64le
25+
26+
COPY --from=build-s390x /usr/local/bin/ec_linux_s390x.gz /tmp/ec_linux_s390x.gz
27+
RUN gzip -d /tmp/ec_linux_s390x.gz && \
28+
tar -czf /binaries/ec_linux_s390x.tar.gz -C /tmp ec_linux_s390x && \
29+
rm /tmp/ec_linux_s390x
30+
31+
# Cross-compiled binaries (same across all variants, taken from amd64)
32+
# Darwin amd64
33+
COPY --from=build-amd64 /usr/local/bin/ec_darwin_amd64.gz /tmp/ec_darwin_amd64.gz
34+
RUN gzip -d /tmp/ec_darwin_amd64.gz && \
35+
tar -czf /binaries/ec_darwin_amd64.tar.gz -C /tmp ec_darwin_amd64 && \
36+
rm /tmp/ec_darwin_amd64
37+
38+
# Darwin arm64
39+
COPY --from=build-amd64 /usr/local/bin/ec_darwin_arm64.gz /tmp/ec_darwin_arm64.gz
40+
RUN gzip -d /tmp/ec_darwin_arm64.gz && \
41+
tar -czf /binaries/ec_darwin_arm64.tar.gz -C /tmp ec_darwin_arm64 && \
42+
rm /tmp/ec_darwin_arm64
43+
44+
# Windows amd64
45+
COPY --from=build-amd64 /usr/local/bin/ec_windows_amd64.exe.gz /tmp/ec_windows_amd64.exe.gz
46+
RUN gzip -d /tmp/ec_windows_amd64.exe.gz && \
47+
tar -czf /binaries/ec_windows_amd64.tar.gz -C /tmp ec_windows_amd64.exe && \
48+
rm /tmp/ec_windows_amd64.exe
49+
50+
# Final minimal image with all binaries
51+
FROM registry.redhat.io/ubi9/ubi-minimal@sha256:69f5c9886ecb19b23e88275a5cd904c47dd982dfa370fbbd0c356d7b1047ef68
52+
53+
LABEL description="Flat image containing Conforma CLI binaries for all platforms and architectures"
54+
LABEL io.k8s.description="Flat image containing Conforma CLI binaries for all platforms and architectures"
55+
LABEL io.opencontainers.image.description="Flat image containing Conforma CLI binaries for all platforms and architectures"
56+
LABEL io.k8s.display-name="Conforma CLI stack image for Red Hat Trusted Artifact Signer"
57+
LABEL io.openshift.tags="conforma trusted-artifact-signer cli-stack"
58+
LABEL summary="Provides Conforma CLI binaries as tar.gz archives for CDN distribution."
59+
LABEL com.redhat.component="conforma-cli-stack"
60+
61+
COPY --from=packager /binaries/ /binaries/
62+
COPY --from=build-amd64 /licenses/ /licenses/
63+
64+
RUN chown -R root:0 /binaries && chmod -R g+r /binaries
65+
66+
USER 65532:65532

0 commit comments

Comments
 (0)