Skip to content

Commit 5299962

Browse files
authored
Merge pull request #47 from Mangaal/enable-konflux
Update tekton configuration and add a new dockerfile for downstream build
2 parents 2a9ca63 + 0053b51 commit 5299962

File tree

4 files changed

+48
-2
lines changed

4 files changed

+48
-2
lines changed

.konflux/Containerfile.plugin

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Build Stage
2+
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_golang_1.22 AS builder
3+
WORKDIR /go/src
4+
COPY . /go/src
5+
RUN GIT_COMMIT=$(git rev-parse HEAD) && \
6+
CGO_ENABLED=0 GOOS=linux go build -a -mod=readonly \
7+
-ldflags "-X github.com/redhat-developer/gitops-backend/pkg/health.GitRevision=${GIT_COMMIT}" ./cmd/backend-http
8+
9+
# Final Stage
10+
FROM registry.access.redhat.com/ubi8/ubi-minimal
11+
WORKDIR /
12+
COPY --from=builder /go/src/backend-http .
13+
EXPOSE 8080
14+
ENTRYPOINT ["./backend-http"]
15+
16+
LABEL \
17+
name="openshift-gitops-1/gitops-rhel8" \
18+
License="Apache 2.0" \
19+
com.redhat.component="openshift-gitops-container" \
20+
com.redhat.delivery.appregistry="false" \
21+
upstream-vcs-type="git" \
22+
summary="Red Hat OpenShift GitOps Backend Service" \
23+
io.openshift.expose-services="" \
24+
io.openshift.tags="openshift,gitops" \
25+
io.k8s.display-name="Red Hat OpenShift GitOps Backend Service" \
26+
maintainer="William Tam <[email protected]>" \
27+
description="Red Hat OpenShift GitOps Backend Service"

.tekton/gitops-backend-pull-request.yaml

+8-1
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,15 @@ spec:
2626
value: quay.io/redhat-user-workloads/rh-openshift-gitops-tenant/openshift-gitops-operator/gitops-backend:on-pr-{{revision}}
2727
- name: image-expires-after
2828
value: 5d
29+
- name: build-platforms
30+
value:
31+
- linux/x86_64
2932
- name: dockerfile
30-
value: Dockerfile
33+
value: .konflux/Containerfile.plugin
34+
- name: hermetic
35+
value: "true"
36+
- name: prefetch-input
37+
value: '{"type": "gomod", "path": "."}'
3138
pipelineSpec:
3239
description: |
3340
This pipeline is ideal for building multi-arch container images from a Containerfile while maintaining trust after pipeline customization.

.tekton/gitops-backend-push.yaml

+11-1
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,18 @@ spec:
2323
value: '{{revision}}'
2424
- name: output-image
2525
value: quay.io/redhat-user-workloads/rh-openshift-gitops-tenant/openshift-gitops-operator/gitops-backend:{{revision}}
26+
- name: build-platforms
27+
value:
28+
- linux/x86_64
29+
- linux/arm64
30+
- linux/ppc64le
31+
- linux/s390x
2632
- name: dockerfile
27-
value: Dockerfile
33+
value: .konflux/Containerfile.plugin
34+
- name: hermetic
35+
value: "true"
36+
- name: prefetch-input
37+
value: '{"type": "gomod", "path": "."}'
2838
pipelineSpec:
2939
description: |
3040
This pipeline is ideal for building multi-arch container images from a Containerfile while maintaining trust after pipeline customization.

go.mod

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module github.com/redhat-developer/gitops-backend
22

33
go 1.22
44

5+
toolchain go1.22.5
6+
57
require (
68
github.com/argoproj/argo-cd v0.8.1-0.20210326223336-719d6a9c252e
79
github.com/go-git/go-git/v5 v5.1.0

0 commit comments

Comments
 (0)