Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tekton configuration and add a new dockerfile for downstream build #47

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
31 changes: 31 additions & 0 deletions .konflux/Containerfile.plugin
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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" \
version=${CI_CONTAINER_VERSION} \
License="Apache 2.0" \
com.redhat.component="openshift-gitops-container" \
com.redhat.delivery.appregistry="false" \
release=${CI_CONTAINER_RELEASE} \
upstream-version=${CI_UPSTREAM_VERSION} \
upstream-vcs-ref="${CI_GITOPS_BACKEND_UPSTREAM_COMMIT}" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to find replacements for CI_* env vars. If I am not wrong, these vars are CPAAS specific. We need to figure out konflux equivalent for these or manually define them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @svghadi , you are right, I will try to find konflux equivalent for these

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even I need them for dex builds. Let me know if you find them.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can address this during release pipeline configurations, shouldn't be a blocker for merging this PR.

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 <[email protected]>" \
description="Red Hat OpenShift GitOps Backend Service"
12 changes: 11 additions & 1 deletion .tekton/gitops-backend-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,18 @@ 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: hermetic
value: "true"
- name: prefetch-input
value: '{"type": "gomod", "path": "."}'
- name: build-platforms
value:
- linux/x86_64
- linux/arm64
- linux/ppc64le
- linux/s390x
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- linux/arm64
- linux/ppc64le
- linux/s390x

Let's run PR builds only on amd64. I noticed long delays in setting up build env for non amd archs.

- name: dockerfile
value: Dockerfile
value: .konflux/Containerfile.plugin
pipelineSpec:
description: |
This pipeline is ideal for building multi-arch container images from a Containerfile while maintaining trust after pipeline customization.
Expand Down
12 changes: 11 additions & 1 deletion .tekton/gitops-backend-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: hermetic
value: "true"
- name: prefetch-input
value: '{"type": "gomod", "path": "."}'
- name: build-platforms
value:
- linux/x86_64
- linux/arm64
- linux/ppc64le
- linux/s390x
- name: dockerfile
value: Dockerfile
value: .konflux/Containerfile.plugin
pipelineSpec:
description: |
This pipeline is ideal for building multi-arch container images from a Containerfile while maintaining trust after pipeline customization.
Expand Down
Loading