|
| 1 | +--- |
| 2 | +apiVersion: tekton.dev/v1 |
| 3 | +kind: Task |
| 4 | +metadata: |
| 5 | + name: pre-build-git |
| 6 | + annotations: |
| 7 | + tekton.dev/pipelines.minVersion: 0.12.1 |
| 8 | + tekton.dev/tags: image-build, konflux |
| 9 | + labels: |
| 10 | + app.kubernetes.io/version: "0.1" |
| 11 | + build.appstudio.redhat.com/build_type: docker |
| 12 | +spec: |
| 13 | + description: |- |
| 14 | + Sets up pre-build for pushing the source. |
| 15 | + params: |
| 16 | + - name: NAME |
| 17 | + description: Name of the pipeline run (i.e. unique dependency build name) |
| 18 | + type: string |
| 19 | + - name: GIT_IDENTITY |
| 20 | + description: Git username. If empty, deploy-pre-build-source step will be skipped. |
| 21 | + type: string |
| 22 | + default: "" |
| 23 | + - name: GIT_URL |
| 24 | + description: String to determine whether we're using gitlab or github |
| 25 | + type: string |
| 26 | + default: "github" |
| 27 | + - name: GIT_SSL_VERIFICATION |
| 28 | + description: Whether to disable ssl verification |
| 29 | + type: string |
| 30 | + default: "false" |
| 31 | + - name: GIT_REUSE_REPOSITORY |
| 32 | + description: Whether to reuse existing git repository or create new one |
| 33 | + type: string |
| 34 | + default: "false" |
| 35 | + - name: SCM_URL |
| 36 | + description: Reference to the git repository |
| 37 | + type: string |
| 38 | + - name: SCM_HASH |
| 39 | + description: Git hash |
| 40 | + type: string |
| 41 | + - name: JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE |
| 42 | + description: Name of the processor image. Useful to override for development. |
| 43 | + type: string |
| 44 | + default: "quay.io/ncross/hacbs-jvm-build-request-processor:latest" |
| 45 | + # default: "quay.io/redhat-user-workloads/konflux-jbs-pnc-tenant/jvm-build-service/build-request-processor:latest" |
| 46 | + results: |
| 47 | + - name: GIT_ARCHIVE |
| 48 | + description: Git archive information |
| 49 | + workspaces: |
| 50 | + - description: The git repo will be cloned onto the volume backing this Workspace. |
| 51 | + name: source |
| 52 | + mountPath: /var/workdir |
| 53 | + steps: |
| 54 | + - name: create-pre-build-source |
| 55 | + image: $(params.JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE) |
| 56 | + securityContext: |
| 57 | + runAsUser: 0 |
| 58 | + computeResources: |
| 59 | + limits: |
| 60 | + cpu: 300m |
| 61 | + memory: 512Mi |
| 62 | + requests: |
| 63 | + cpu: 10m |
| 64 | + memory: 512Mi |
| 65 | + env: |
| 66 | + - name: GIT_DEPLOY_TOKEN |
| 67 | + valueFrom: |
| 68 | + secretKeyRef: |
| 69 | + optional: true |
| 70 | + name: jvm-build-git-repo-secrets |
| 71 | + key: gitdeploytoken |
| 72 | + args: |
| 73 | + - deploy-pre-build-source |
| 74 | + - --source-path=$(workspaces.source.path)/source |
| 75 | + - --task-run-name=$(context.taskRun.name) |
| 76 | + - --scm-uri=$(params.SCM_URL) |
| 77 | + - --scm-commit=$(params.SCM_HASH) |
| 78 | + - --image-id=$(params.NAME) |
| 79 | + - --git-identity=$(params.GIT_IDENTITY) |
| 80 | + - --git-url=$(params.GIT_URL) |
| 81 | + - --git-disable-ssl-verification=$(params.GIT_SSL_VERIFICATION) |
| 82 | + - --git-reuse-repository=$(params.GIT_REUSE_REPOSITORY) |
0 commit comments