diff --git a/.konflux/Containerfile.plugin b/.konflux/Containerfile.plugin new file mode 100644 index 0000000..881bf0b --- /dev/null +++ b/.konflux/Containerfile.plugin @@ -0,0 +1,27 @@ +# Build Stage +FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_golang_1.22 AS builder +WORKDIR /go/src +COPY . /go/src +RUN GIT_COMMIT=$(git rev-parse HEAD) && \ + CGO_ENABLED=0 GOOS=linux go build -a -mod=readonly \ + -ldflags "-X github.com/redhat-developer/gitops-backend/pkg/health.GitRevision=${GIT_COMMIT}" ./cmd/backend-http + +# Final Stage +FROM registry.access.redhat.com/ubi8/ubi-minimal +WORKDIR / +COPY --from=builder /go/src/backend-http . +EXPOSE 8080 +ENTRYPOINT ["./backend-http"] + +LABEL \ + name="openshift-gitops-1/gitops-rhel8" \ + License="Apache 2.0" \ + com.redhat.component="openshift-gitops-container" \ + com.redhat.delivery.appregistry="false" \ + upstream-vcs-type="git" \ + summary="Red Hat OpenShift GitOps Backend Service" \ + io.openshift.expose-services="" \ + io.openshift.tags="openshift,gitops" \ + io.k8s.display-name="Red Hat OpenShift GitOps Backend Service" \ + maintainer="William Tam " \ + description="Red Hat OpenShift GitOps Backend Service" \ No newline at end of file diff --git a/.tekton/gitops-backend-pull-request.yaml b/.tekton/gitops-backend-pull-request.yaml index 00b2dba..c7a1483 100644 --- a/.tekton/gitops-backend-pull-request.yaml +++ b/.tekton/gitops-backend-pull-request.yaml @@ -26,8 +26,15 @@ spec: value: quay.io/redhat-user-workloads/rh-openshift-gitops-tenant/openshift-gitops-operator/gitops-backend:on-pr-{{revision}} - name: image-expires-after value: 5d + - name: build-platforms + value: + - linux/x86_64 - name: dockerfile - value: Dockerfile + value: .konflux/Containerfile.plugin + - name: hermetic + value: "true" + - name: prefetch-input + value: '{"type": "gomod", "path": "."}' pipelineSpec: description: | This pipeline is ideal for building multi-arch container images from a Containerfile while maintaining trust after pipeline customization. diff --git a/.tekton/gitops-backend-push.yaml b/.tekton/gitops-backend-push.yaml index f01a354..46d2cd9 100644 --- a/.tekton/gitops-backend-push.yaml +++ b/.tekton/gitops-backend-push.yaml @@ -23,8 +23,18 @@ spec: value: '{{revision}}' - name: output-image value: quay.io/redhat-user-workloads/rh-openshift-gitops-tenant/openshift-gitops-operator/gitops-backend:{{revision}} + - name: build-platforms + value: + - linux/x86_64 + - linux/arm64 + - linux/ppc64le + - linux/s390x - name: dockerfile - value: Dockerfile + value: .konflux/Containerfile.plugin + - name: hermetic + value: "true" + - name: prefetch-input + value: '{"type": "gomod", "path": "."}' pipelineSpec: description: | This pipeline is ideal for building multi-arch container images from a Containerfile while maintaining trust after pipeline customization. diff --git a/go.mod b/go.mod index 4279bf8..e8f9755 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,8 @@ module github.com/redhat-developer/gitops-backend go 1.22 +toolchain go1.22.5 + require ( github.com/argoproj/argo-cd v0.8.1-0.20210326223336-719d6a9c252e github.com/go-git/go-git/v5 v5.1.0