@@ -15,23 +15,57 @@ spec:
15
15
- name : target-dir
16
16
description : Target directory relative to workspace where to save downloaded blobs.
17
17
type : string
18
- default : " source"
18
+ default : " ."
19
+ - name : SOURCE_ARTIFACT
20
+ description : The Trusted Artifact URI pointing to the artifact with
21
+ the application source code. This should be the result of the git-clone task,
22
+ results from other tasks might fail as dirty.
23
+ type : string
24
+ - name : ociStorage
25
+ description : The OCI repository where the Trusted Artifacts are stored.
26
+ type : string
27
+ - name : ociArtifactExpiresAfter
28
+ description : Expiration date for the trusted artifacts created in the
29
+ OCI repository.
30
+ type : string
19
31
results :
32
+ - name : SOURCE_ARTIFACT
33
+ description : The Trusted Artifact URI pointing to the artifact with the application source code
34
+ and additional smuggled activation key.
35
+ type : string
36
+ volumes :
37
+ - name : workdir
38
+ emptyDir : { }
39
+ stepTemplate :
40
+ volumeMounts :
41
+ - mountPath : /var/workdir
42
+ name : workdir
20
43
steps :
44
+ - name : use-trusted-artifact
45
+ image : quay.io/redhat-appstudio/build-trusted-artifacts:latest@sha256:601e0999ae062e5ee666538d651af7893a75e415b7952c85caa8a4452501029a
46
+ args :
47
+ - use
48
+ - $(params.SOURCE_ARTIFACT)=/var/workdir/source
21
49
- name : fetch-scanner-data
22
50
image : registry.access.redhat.com/ubi8/ubi-minimal:latest
23
51
# The only functioning way to pass array parameter that I found is through args array.
24
52
# Array params have weird limitations, see https://github.com/tektoncd/pipeline/blob/main/docs/tasks.md#substituting-array-parameters
25
53
# Attempts to pass this in other places result in webhook errors and pipeline not starting.
26
54
args : [ "$(params.blobs-to-fetch[*])" ]
55
+ workingDir : /var/workdir/source
27
56
script : |
28
57
#!/usr/bin/env bash
29
58
set -euo pipefail
30
- exec "$(workspaces.source.path)/source/scripts/konflux/fetch-scanner-data.sh" \
31
- "$(workspaces.source.path)/$(params.target-dir)" \
32
- "$@"
59
+ scripts/konflux/fetch-scanner-data.sh "$(params.target-dir)" "$@"
33
60
# It should not take long to download blobs otherwise there's something odd going on.
34
61
timeout : 10m
35
- workspaces :
36
- - name : source
37
- description : Workspace with the source code.
62
+ - name : create-trusted-artifact
63
+ image : quay.io/redhat-appstudio/build-trusted-artifacts:latest@sha256:601e0999ae062e5ee666538d651af7893a75e415b7952c85caa8a4452501029a
64
+ args :
65
+ - create
66
+ - --store
67
+ - $(params.ociStorage)
68
+ - $(results.SOURCE_ARTIFACT.path)=/var/workdir/source
69
+ env :
70
+ - name : IMAGE_EXPIRES_AFTER
71
+ value : $(params.ociArtifactExpiresAfter)
0 commit comments