Skip to content

Commit

Permalink
Enable hermetic builds
Browse files Browse the repository at this point in the history
Signed-off-by: Dale Haiducek <[email protected]>
  • Loading branch information
dhaiducek committed Jan 8, 2025
1 parent 392b545 commit fa865a4
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .tekton/cert-policy-controller-acm-213-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ spec:
value: build/Dockerfile.rhtap
- name: path-context
value: .
- name: hermetic
value: "true"
- name: prefetch-input
value: '[{"type": "gomod", "path": "."},{"type": "rpm", "path": "build"}]'
pipelineSpec:
description: |
This pipeline is ideal for building multi-arch container images from a Containerfile while maintaining trust after pipeline customization.
Expand Down Expand Up @@ -181,6 +185,8 @@ spec:
value: $(params.output-image).prefetch
- name: ociArtifactExpiresAfter
value: $(params.image-expires-after)
- name: dev-package-managers
value: "true"
runAfter:
- clone-repository
taskRef:
Expand Down
6 changes: 6 additions & 0 deletions .tekton/cert-policy-controller-acm-213-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ spec:
value: build/Dockerfile.rhtap
- name: path-context
value: .
- name: hermetic
value: "true"
- name: prefetch-input
value: '[{"type": "gomod", "path": "."},{"type": "rpm", "path": "build"}]'
pipelineSpec:
description: |
This pipeline is ideal for building multi-arch container images from a Containerfile while maintaining trust after pipeline customization.
Expand Down Expand Up @@ -178,6 +182,8 @@ spec:
value: $(params.output-image).prefetch
- name: ociArtifactExpiresAfter
value: $(params.image-expires-after)
- name: dev-package-managers
value: "true"
runAfter:
- clone-repository
taskRef:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ clean:

.PHONY: build
build:
CGO_ENABLED=1 go build -o ./build/_output/bin/$(IMG) ./main.go
CGO_ENABLED=1 go build -mod=readonly -o ./build/_output/bin/$(IMG) ./main.go

# Run against the current locally configured Kubernetes cluster
.PHONY: run
Expand Down
1 change: 0 additions & 1 deletion build/Dockerfile.rhtap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ENV COMPONENT=cert-policy-controller
ENV REPO_PATH=/go/src/github.com/stolostron/${COMPONENT}
WORKDIR ${REPO_PATH}
COPY . .
RUN go mod vendor
RUN make build

# Stage 2: Copy the binaries from the image builder to the base image
Expand Down
9 changes: 9 additions & 0 deletions build/rpms.in.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
contentOrigin:
repofiles:
- /etc/yum.repos.d/ubi.repo
packages: []
arches:
- aarch64
- x86_64
- s390x
- ppc64le
20 changes: 20 additions & 0 deletions build/rpms.lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
lockfileVersion: 1
lockfileVendor: redhat
arches:
- arch: aarch64
packages: []
source: []
module_metadata: []
- arch: ppc64le
packages: []
source: []
module_metadata: []
- arch: s390x
packages: []
source: []
module_metadata: []
- arch: x86_64
packages: []
source: []
module_metadata: []

0 comments on commit fa865a4

Please sign in to comment.