RedHatInsights/insights-rbac-ui

View on GitHub
.tekton/insights-rbac-ui-pull-request.yaml

Summary

Maintainability
Test Coverage
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
  annotations:
    build.appstudio.openshift.io/repo: https://github.com/RedHatInsights/insights-rbac-ui?rev={{revision}}
    build.appstudio.redhat.com/commit_sha: '{{revision}}'
    build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}'
    build.appstudio.redhat.com/target_branch: '{{target_branch}}'
    pipelinesascode.tekton.dev/max-keep-runs: "3"
    pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
      == "master"
  creationTimestamp: null
  labels:
    appstudio.openshift.io/application: insights-rbac-ui
    appstudio.openshift.io/component: insights-rbac-ui
    pipelines.appstudio.openshift.io/type: build
  name: insights-rbac-ui-on-pull-request
  namespace: rh-platform-experien-tenant
spec:
  params:
  - name: git-url
    value: '{{source_url}}'
  - name: revision
    value: '{{revision}}'
  - name: output-image
    value: quay.io/redhat-user-workloads/rh-platform-experien-tenant/insights-rbac-ui/insights-rbac-ui:on-pr-{{revision}}
  - name: image-expires-after
    value: 5d
  - name: dockerfile
    value: ./Dockerfile
  pipelineSpec:
    finally:
    - name: show-sbom
      params:
      - name: IMAGE_URL
        value: $(tasks.build-container.results.IMAGE_URL)
      taskRef:
        params:
        - name: name
          value: show-sbom
        - name: bundle
          value: quay.io/konflux-ci/tekton-catalog/task-show-sbom:0.1@sha256:52f8b96b96ce4203d4b74d850a85f963125bf8eef0683ea5acdd80818d335a28
        - name: kind
          value: task
        resolver: bundles
    - name: show-summary
      params:
      - name: pipelinerun-name
        value: $(context.pipelineRun.name)
      - name: git-url
        value: $(tasks.clone-repository.results.url)?rev=$(tasks.clone-repository.results.commit)
      - name: image-url
        value: $(params.output-image)
      - name: build-task-status
        value: $(tasks.build-container.status)
      taskRef:
        params:
        - name: name
          value: summary
        - name: bundle
          value: quay.io/konflux-ci/tekton-catalog/task-summary:0.2@sha256:d97c04ab42f277b1103eb6f3a053b247849f4f5b3237ea302a8ecada3b24e15b
        - name: kind
          value: task
        resolver: bundles
      workspaces:
      - name: workspace
        workspace: workspace
    params:
    - description: Source Repository URL
      name: git-url
      type: string
    - default: ""
      description: Revision of the Source Repository
      name: revision
      type: string
    - description: Fully Qualified Output Image
      name: output-image
      type: string
    - default: .
      description: Path to the source code of an application's component from where
        to build image.
      name: path-context
      type: string
    - default: Dockerfile
      description: Path to the Dockerfile inside the context specified by parameter
        path-context
      name: dockerfile
      type: string
    - default: "false"
      description: Force rebuild image
      name: rebuild
      type: string
    - default: "false"
      description: Skip checks against built image
      name: skip-checks
      type: string
    - default: "false"
      description: Execute the build with network isolation
      name: hermetic
      type: string
    - default: ""
      description: Build dependencies to be prefetched by Cachi2
      name: prefetch-input
      type: string
    - default: "false"
      description: Java build
      name: java
      type: string
    - default: ""
      description: Image tag expiration time, time values could be something like
        1h, 2d, 3w for hours, days, and weeks, respectively.
      name: image-expires-after
    - default: "false"
      description: Build a source image.
      name: build-source-image
      type: string
    - default: []
      description: Array of --build-arg values ("arg=value" strings) for buildah
      name: build-args
      type: array
    - default: ""
      description: Path to a file with build arguments for buildah, see https://www.mankier.com/1/buildah-build#--build-arg-file
      name: build-args-file
      type: string
    results:
    - description: ""
      name: IMAGE_URL
      value: $(tasks.build-container.results.IMAGE_URL)
    - description: ""
      name: IMAGE_DIGEST
      value: $(tasks.build-container.results.IMAGE_DIGEST)
    - description: ""
      name: CHAINS-GIT_URL
      value: $(tasks.clone-repository.results.url)
    - description: ""
      name: CHAINS-GIT_COMMIT
      value: $(tasks.clone-repository.results.commit)
    - description: ""
      name: JAVA_COMMUNITY_DEPENDENCIES
      value: $(tasks.build-container.results.JAVA_COMMUNITY_DEPENDENCIES)
    tasks:
    - name: init
      params:
      - name: image-url
        value: $(params.output-image)
      - name: rebuild
        value: $(params.rebuild)
      - name: skip-checks
        value: $(params.skip-checks)
      taskRef:
        params:
        - name: name
          value: init
        - name: bundle
          value: quay.io/konflux-ci/tekton-catalog/task-init:0.2@sha256:092c113b614f6551113f17605ae9cb7e822aa704d07f0e37ed209da23ce392cc
        - name: kind
          value: task
        resolver: bundles
    - name: clone-repository
      params:
      - name: url
        value: $(params.git-url)
      - name: revision
        value: $(params.revision)
      runAfter:
      - init
      taskRef:
        params:
        - name: name
          value: git-clone
        - name: bundle
          value: quay.io/konflux-ci/tekton-catalog/task-git-clone:0.1@sha256:2cccdf8729ad4d5adf65e8b66464f8efa1e1c87ba16d343b4a6c621a2a40f7e1
        - name: kind
          value: task
        resolver: bundles
      when:
      - input: $(tasks.init.results.build)
        operator: in
        values:
        - "true"
      workspaces:
      - name: output
        workspace: workspace
      - name: basic-auth
        workspace: git-auth
    - name: prefetch-dependencies
      params:
      - name: input
        value: $(params.prefetch-input)
      runAfter:
      - clone-repository
      taskRef:
        params:
        - name: name
          value: prefetch-dependencies
        - name: bundle
          value: quay.io/konflux-ci/tekton-catalog/task-prefetch-dependencies:0.1@sha256:fe7234e3824d1e65d6a7aac352e7a6bbce623d90d8d7da9aceeee108ad2c61be
        - name: kind
          value: task
        resolver: bundles
      when:
      - input: $(params.prefetch-input)
        operator: notin
        values:
        - ""
      workspaces:
      - name: source
        workspace: workspace
      - name: git-basic-auth
        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: 6ca6bf7cbbe1dd25a5b8e50ebb832041533bf4b3
          - 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: 6ca6bf7cbbe1dd25a5b8e50ebb832041533bf4b3
          - 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:81c4864dae6bb11595f657be887e205262e70086a05ed16ada827fd6391926ac
            args:
              - use
              - $(params.SOURCE_ARTIFACT)=/var/workdir
          - image: registry.access.redhat.com/ubi8/nodejs-18
            workingDir: /var/workdir
            name: unit-tests
            computeResources:
              requests:
                memory: 4Gi
                cpu: 2000m
              limits:
                memory: 4Gi
                cpu: 2000m
            securityContext:
              runAsUser: 0
            script: |
              #!/bin/bash
              set -ex
              
              npm install
              npm run lint
              npm test --  --runInBand --no-cache
    - name: build-container
      params:
      - name: IMAGE
        value: $(params.output-image)
      - name: DOCKERFILE
        value: $(params.dockerfile)
      - name: CONTEXT
        value: $(params.path-context)
      - name: HERMETIC
        value: $(params.hermetic)
      - name: PREFETCH_INPUT
        value: $(params.prefetch-input)
      - name: IMAGE_EXPIRES_AFTER
        value: $(params.image-expires-after)
      - name: COMMIT_SHA
        value: $(tasks.clone-repository.results.commit)
      - name: BUILD_ARGS
        value:
        - $(params.build-args[*])
      - name: BUILD_ARGS_FILE
        value: $(params.build-args-file)
      runAfter:
      - prefetch-dependencies
      - create-frontend-dockerfile
      taskRef:
        params:
        - name: name
          value: buildah
        - name: bundle
          value: quay.io/konflux-ci/tekton-catalog/task-buildah:0.2@sha256:b105a3bcc57274c6cb0884d915bc71935c9334d1a3571d83e1df8641f0268f8b
        - name: kind
          value: task
        resolver: bundles
      when:
      - input: $(tasks.init.results.build)
        operator: in
        values:
        - "true"
      workspaces:
      - name: source
        workspace: workspace
    - name: build-source-image
      params:
      - name: BINARY_IMAGE
        value: $(params.output-image)
      runAfter:
      - build-container
      taskRef:
        params:
        - name: name
          value: source-build
        - name: bundle
          value: quay.io/konflux-ci/tekton-catalog/task-source-build:0.1@sha256:21cb5ebaff7a9216903cf78933dc4ec4dd6283a52636b16590a5f52ceb278269
        - name: kind
          value: task
        resolver: bundles
      when:
      - input: $(tasks.init.results.build)
        operator: in
        values:
        - "true"
      - input: $(params.build-source-image)
        operator: in
        values:
        - "true"
      workspaces:
      - name: workspace
        workspace: workspace
    - name: deprecated-base-image-check
      params:
      - name: IMAGE_URL
        value: $(tasks.build-container.results.IMAGE_URL)
      - name: IMAGE_DIGEST
        value: $(tasks.build-container.results.IMAGE_DIGEST)
      runAfter:
      - build-container
      taskRef:
        params:
        - name: name
          value: deprecated-image-check
        - name: bundle
          value: quay.io/konflux-ci/tekton-catalog/task-deprecated-image-check:0.4@sha256:b4f9599f5770ea2e6e4d031224ccc932164c1ecde7f85f68e16e99c98d754003
        - name: kind
          value: task
        resolver: bundles
      when:
      - input: $(params.skip-checks)
        operator: in
        values:
        - "false"
    - name: clair-scan
      params:
      - name: image-digest
        value: $(tasks.build-container.results.IMAGE_DIGEST)
      - name: image-url
        value: $(tasks.build-container.results.IMAGE_URL)
      runAfter:
      - build-container
      taskRef:
        params:
        - name: name
          value: clair-scan
        - name: bundle
          value: quay.io/konflux-ci/tekton-catalog/task-clair-scan:0.2@sha256:28fee4bf5da87f2388c973d9336086749cad8436003f9a514e22ac99735e056b
        - name: kind
          value: task
        resolver: bundles
      when:
      - input: $(params.skip-checks)
        operator: in
        values:
        - "false"
    - name: ecosystem-cert-preflight-checks
      params:
      - name: image-url
        value: $(tasks.build-container.results.IMAGE_URL)
      runAfter:
      - build-container
      taskRef:
        params:
        - name: name
          value: ecosystem-cert-preflight-checks
        - name: bundle
          value: quay.io/konflux-ci/tekton-catalog/task-ecosystem-cert-preflight-checks:0.1@sha256:5131cce0f93d0b728c7bcc0d6cee4c61d4c9f67c6d619c627e41e3c9775b497d
        - name: kind
          value: task
        resolver: bundles
      when:
      - input: $(params.skip-checks)
        operator: in
        values:
        - "false"
    - name: sast-snyk-check
      params:
      - name: image-digest
        value: $(tasks.build-container.results.IMAGE_DIGEST)
      - name: image-url
        value: $(tasks.build-container.results.IMAGE_URL)
      runAfter:
      - build-container
      taskRef:
        params:
        - name: name
          value: sast-snyk-check
        - name: bundle
          value: quay.io/konflux-ci/tekton-catalog/task-sast-snyk-check:0.3@sha256:60ed62a64d73596a569eb12453e4f35b13d4f7f1a32a52415cdbeaf1abda5d45
        - name: kind
          value: task
        resolver: bundles
      when:
      - input: $(params.skip-checks)
        operator: in
        values:
        - "false"
      workspaces:
      - name: workspace
        workspace: workspace
    - name: clamav-scan
      params:
      - name: image-digest
        value: $(tasks.build-container.results.IMAGE_DIGEST)
      - name: image-url
        value: $(tasks.build-container.results.IMAGE_URL)
      runAfter:
      - build-container
      taskRef:
        params:
        - name: name
          value: clamav-scan
        - name: bundle
          value: quay.io/konflux-ci/tekton-catalog/task-clamav-scan:0.1@sha256:a94b6523ba0b691dc276e37594321c2eff3594d2753014e5c920803b47627df1
        - name: kind
          value: task
        resolver: bundles
      when:
      - input: $(params.skip-checks)
        operator: in
        values:
        - "false"
    - name: sbom-json-check
      params:
      - name: IMAGE_URL
        value: $(tasks.build-container.results.IMAGE_URL)
      - name: IMAGE_DIGEST
        value: $(tasks.build-container.results.IMAGE_DIGEST)
      runAfter:
      - build-container
      taskRef:
        params:
        - name: name
          value: sbom-json-check
        - name: bundle
          value: quay.io/konflux-ci/tekton-catalog/task-sbom-json-check:0.2@sha256:468b5615993bb6d75df3d66180df5eb8728bbef59efe509eb5ac89b7ac582f16
        - name: kind
          value: task
        resolver: bundles
      when:
      - input: $(params.skip-checks)
        operator: in
        values:
        - "false"
    - name: apply-tags
      params:
      - name: IMAGE
        value: $(tasks.build-container.results.IMAGE_URL)
      runAfter:
      - build-container
      taskRef:
        params:
        - name: name
          value: apply-tags
        - name: bundle
          value: quay.io/konflux-ci/tekton-catalog/task-apply-tags:0.1@sha256:f485e250fb060060892b633c495a3d7e38de1ec105ae1be48608b0401530ab2c
        - name: kind
          value: task
        resolver: bundles
    - name: push-dockerfile
      params:
      - name: IMAGE
        value: $(tasks.build-container.results.IMAGE_URL)
      - name: IMAGE_DIGEST
        value: $(tasks.build-container.results.IMAGE_DIGEST)
      - name: DOCKERFILE
        value: $(params.dockerfile)
      - name: CONTEXT
        value: $(params.path-context)
      runAfter:
      - build-container
      taskRef:
        params:
        - name: name
          value: push-dockerfile
        - name: bundle
          value: quay.io/konflux-ci/tekton-catalog/task-push-dockerfile:0.1@sha256:674e70f7d724aaf1dd631ba9be2998ab0305fb3e0d9ec361351cc5e57bcdd3ec
        - name: kind
          value: task
        resolver: bundles
      workspaces:
      - name: workspace
        workspace: workspace
    workspaces:
    - name: workspace
    - name: git-auth
      optional: true
    - name: netrc
      optional: true
  taskRunTemplate: {}
  workspaces:
  - name: workspace
    volumeClaimTemplate:
      metadata:
        creationTimestamp: null
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 1Gi
      status: {}
  - name: git-auth
    secret:
      secretName: '{{ git_auth_secret }}'
status: {}