diff --git a/.tekton/compliance-frontend-pull-request.yaml b/.tekton/compliance-frontend-pull-request.yaml index 6937883dc..2c3116a07 100644 --- a/.tekton/compliance-frontend-pull-request.yaml +++ b/.tekton/compliance-frontend-pull-request.yaml @@ -193,6 +193,135 @@ spec: workspace: git-auth - name: netrc workspace: netrc + - name: parse-build-deploy-script + params: + - name: path-context + value: $(params.path-context) + taskRef: + resolver: git + params: + - name: url + value: https://github.com/RedHatInsights/konflux-consoledot-frontend-build + - name: revision + value: a6838b71b88dc1e84f11764c9734e4880096585d # replace with the latest commit from https://github.com/RedHatInsights/konflux-consoledot-frontend-build/commits + - name: pathInRepo + value: tasks/parse-build-deploy-script/parse-build-deploy-script.yaml + workspaces: + - name: source + workspace: workspace + runAfter: + - clone-repository + - name: create-frontend-dockerfile + taskRef: + resolver: git + params: + - name: url + value: https://github.com/RedHatInsights/konflux-consoledot-frontend-build + - name: revision + value: a6838b71b88dc1e84f11764c9734e4880096585d # replace with the latest commit from https://github.com/RedHatInsights/konflux-consoledot-frontend-build/commits + - name: pathInRepo + value: tasks/create-frontend-dockerfile/create-frontend-dockerfile.yaml + workspaces: + - name: source + workspace: workspace + params: + - name: path-context + value: $(params.path-context) + - name: component + value: $(tasks.parse-build-deploy-script.results.component) + - name: image + value: $(tasks.parse-build-deploy-script.results.image) + - name: node-build-version + value: $(tasks.parse-build-deploy-script.results.node-build-version) + - name: quay-expire-time + value: $(tasks.parse-build-deploy-script.results.quay-expire-time) + - name: npm-build-script + value: $(tasks.parse-build-deploy-script.results.npm-build-script) + - name: yarn-build-script + value: $(tasks.parse-build-deploy-script.results.yarn-build-script) + - name: route-path + value: $(tasks.parse-build-deploy-script.results.route-path) + - name: beta-route-path + value: $(tasks.parse-build-deploy-script.results.beta-route-path) + - name: preview-route-path + value: $(tasks.parse-build-deploy-script.results.preview-route-path) + - name: ci-root + value: $(tasks.parse-build-deploy-script.results.ci-root) + - name: server-name + value: $(tasks.parse-build-deploy-script.results.server-name) + - name: dist-folder + value: $(tasks.parse-build-deploy-script.results.dist-folder) + runAfter: + - parse-build-deploy-script + - name: clone-repository-oci-ta + params: + - name: url + value: $(params.git-url) + - name: revision + value: $(params.revision) + - name: ociStorage + value: $(params.output-image).git + runAfter: + - init + taskRef: + params: + - name: name + value: git-clone-oci-ta + - name: bundle + value: quay.io/konflux-ci/tekton-catalog/task-git-clone-oci-ta@sha256:0f4360ce144d46171ebd2e8f4d4575539a0600e02208ba5fc9beeb2c27ddfd4c + - name: kind + value: task + resolver: bundles + when: + - input: $(tasks.init.results.build) + operator: in + values: + - "true" + workspaces: + - name: basic-auth + workspace: git-auth + # - name: run-unit-tests + # description: Validates frontend unit tests + # params: + # - name: SOURCE_ARTIFACT + # value: $(tasks.clone-repository-oci-ta.results.SOURCE_ARTIFACT) + # runAfter: + # - clone-repository-oci-ta + # workspaces: + # - name: basic-auth + # workspace: git-auth + # taskSpec: + # params: + # - description: The Trusted Artifact URI pointing to the artifact with the application source code. + # name: SOURCE_ARTIFACT + # type: string + # volumes: + # # New volume to store a copy of the source code accessible only to this Task. + # - name: workdir + # emptyDir: {} + # stepTemplate: + # volumeMounts: + # - mountPath: /var/workdir + # name: workdir + # readOnly: false + # sidecars: + # steps: + # - name: use-trusted-artifact + # image: quay.io/redhat-appstudio/build-trusted-artifacts:latest@sha256:8391272c4e5011120e9e7fee2c1f339e9405366110bf239dadcbc21e953ce099 + # args: + # - use + # - $(params.SOURCE_ARTIFACT)=/var/workdir + # - image: registry.access.redhat.com/ubi8/nodejs-20 + # workingDir: /var/workdir + # name: unit-tests + # securityContext: + # runAsUser: 0 + # script: | + # #!/bin/bash + # set -ex + + # npm install + # npm test - name: build-container params: - name: IMAGE @@ -220,6 +349,7 @@ spec: value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT) runAfter: - prefetch-dependencies + - create-frontend-dockerfile taskRef: params: - name: name diff --git a/.tekton/compliance-frontend-push.yaml b/.tekton/compliance-frontend-push.yaml index b35c4e9cf..718f77e8c 100644 --- a/.tekton/compliance-frontend-push.yaml +++ b/.tekton/compliance-frontend-push.yaml @@ -190,6 +190,135 @@ spec: workspace: git-auth - name: netrc workspace: netrc + - name: parse-build-deploy-script + params: + - name: path-context + value: $(params.path-context) + taskRef: + resolver: git + params: + - name: url + value: https://github.com/RedHatInsights/konflux-consoledot-frontend-build + - name: revision + value: a6838b71b88dc1e84f11764c9734e4880096585d # replace with the latest commit from https://github.com/RedHatInsights/konflux-consoledot-frontend-build/commits + - name: pathInRepo + value: tasks/parse-build-deploy-script/parse-build-deploy-script.yaml + workspaces: + - name: source + workspace: workspace + runAfter: + - clone-repository + - name: create-frontend-dockerfile + taskRef: + resolver: git + params: + - name: url + value: https://github.com/RedHatInsights/konflux-consoledot-frontend-build + - name: revision + value: a6838b71b88dc1e84f11764c9734e4880096585d # replace with the latest commit from https://github.com/RedHatInsights/konflux-consoledot-frontend-build/commits + - name: pathInRepo + value: tasks/create-frontend-dockerfile/create-frontend-dockerfile.yaml + workspaces: + - name: source + workspace: workspace + params: + - name: path-context + value: $(params.path-context) + - name: component + value: $(tasks.parse-build-deploy-script.results.component) + - name: image + value: $(tasks.parse-build-deploy-script.results.image) + - name: node-build-version + value: $(tasks.parse-build-deploy-script.results.node-build-version) + - name: quay-expire-time + value: $(tasks.parse-build-deploy-script.results.quay-expire-time) + - name: npm-build-script + value: $(tasks.parse-build-deploy-script.results.npm-build-script) + - name: yarn-build-script + value: $(tasks.parse-build-deploy-script.results.yarn-build-script) + - name: route-path + value: $(tasks.parse-build-deploy-script.results.route-path) + - name: beta-route-path + value: $(tasks.parse-build-deploy-script.results.beta-route-path) + - name: preview-route-path + value: $(tasks.parse-build-deploy-script.results.preview-route-path) + - name: ci-root + value: $(tasks.parse-build-deploy-script.results.ci-root) + - name: server-name + value: $(tasks.parse-build-deploy-script.results.server-name) + - name: dist-folder + value: $(tasks.parse-build-deploy-script.results.dist-folder) + runAfter: + - parse-build-deploy-script + - name: clone-repository-oci-ta + params: + - name: url + value: $(params.git-url) + - name: revision + value: $(params.revision) + - name: ociStorage + value: $(params.output-image).git + runAfter: + - init + taskRef: + params: + - name: name + value: git-clone-oci-ta + - name: bundle + value: quay.io/konflux-ci/tekton-catalog/task-git-clone-oci-ta@sha256:0f4360ce144d46171ebd2e8f4d4575539a0600e02208ba5fc9beeb2c27ddfd4c + - name: kind + value: task + resolver: bundles + when: + - input: $(tasks.init.results.build) + operator: in + values: + - "true" + workspaces: + - name: basic-auth + workspace: git-auth + # - name: run-unit-tests + # description: Validates frontend unit tests + # params: + # - name: SOURCE_ARTIFACT + # value: $(tasks.clone-repository-oci-ta.results.SOURCE_ARTIFACT) + # runAfter: + # - clone-repository-oci-ta + # workspaces: + # - name: basic-auth + # workspace: git-auth + # taskSpec: + # params: + # - description: The Trusted Artifact URI pointing to the artifact with the application source code. + # name: SOURCE_ARTIFACT + # type: string + # volumes: + # # New volume to store a copy of the source code accessible only to this Task. + # - name: workdir + # emptyDir: {} + # stepTemplate: + # volumeMounts: + # - mountPath: /var/workdir + # name: workdir + # readOnly: false + # sidecars: + # steps: + # - name: use-trusted-artifact + # image: quay.io/redhat-appstudio/build-trusted-artifacts:latest@sha256:8391272c4e5011120e9e7fee2c1f339e9405366110bf239dadcbc21e953ce099 + # args: + # - use + # - $(params.SOURCE_ARTIFACT)=/var/workdir + # - image: registry.access.redhat.com/ubi8/nodejs-20 + # workingDir: /var/workdir + # name: unit-tests + # securityContext: + # runAsUser: 0 + # script: | + # #!/bin/bash + # set -ex + + # npm install + # npm test - name: build-container params: - name: IMAGE @@ -217,6 +346,7 @@ spec: value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT) runAfter: - prefetch-dependencies + - create-frontend-dockerfile taskRef: params: - name: name