@@ -19,10 +19,10 @@ import (
19
19
)
20
20
21
21
const (
22
- PostBuildVolume = "post-build-volume"
23
- WorkspaceSource = "source "
24
- WorkspaceMount = "/var/workdir "
25
- WorkspaceTls = "tls"
22
+ PostBuildVolume = "post-build-volume"
23
+ PostBuildVolumeMount = "/var/workdir "
24
+ WorkspaceSource = "source "
25
+ WorkspaceTls = "tls"
26
26
27
27
GitTaskName = "git-clone"
28
28
PreBuildTaskName = "pre-build"
@@ -138,8 +138,8 @@ func createPipelineSpec(log logr.Logger, tool string, commitTime int64, jbsConfi
138
138
verifyBuiltArtifactsArgs := verifyParameters (jbsConfig , recipe )
139
139
deployArgs := []string {
140
140
"verify" ,
141
- "--path=$(workspaces.source.path) /artifacts" ,
142
- "--logs-path=$(workspaces.source.path) /logs" ,
141
+ fmt . Sprintf ( "--path=%s /artifacts" , PostBuildVolumeMount ) ,
142
+ fmt . Sprintf ( "--logs-path=%s /logs" , PostBuildVolumeMount ) ,
143
143
"--task-run-name=$(context.taskRun.name)" ,
144
144
"--build-id=" + buildId ,
145
145
"--scm-uri=" + db .Spec .ScmInfo .SCMURL ,
@@ -543,31 +543,32 @@ func createPipelineSpec(log logr.Logger, tool string, commitTime int64, jbsConfi
543
543
{Name : PipelineResultPassedVerification },
544
544
{Name : PipelineResultVerificationResult },
545
545
},
546
+ StepTemplate : & tektonpipeline.StepTemplate {
547
+ VolumeMounts : []v1.VolumeMount {{Name : PostBuildVolume , MountPath : PostBuildVolumeMount }},
548
+ },
546
549
Steps : []tektonpipeline.Step {
547
550
{
548
551
Name : "restore-post-build-artifacts" ,
549
- VolumeMounts : []v1.VolumeMount {{Name : PostBuildVolume , MountPath : WorkspaceMount }},
550
552
Image : strings .TrimSpace (strings .Split (buildTrustedArtifacts , "FROM" )[1 ]),
551
553
ImagePullPolicy : v1 .PullIfNotPresent ,
552
554
SecurityContext : & v1.SecurityContext {RunAsUser : & zero },
553
555
Env : secretVariables ,
554
556
// While the manifest digest is available we need the manifest of the layer within the archive hence
555
557
// using 'oras manifest fetch' to extract the correct layer.
556
- Script : fmt .Sprintf (`echo "Restoring artifacts to workspace : $(workspaces.source.path) "
558
+ Script : fmt .Sprintf (`echo "Restoring artifacts"
557
559
export ORAS_OPTIONS="%s"
558
560
URL=%s
559
561
DIGEST=$(tasks.%s.results.IMAGE_DIGEST)
560
562
AARCHIVE=$(oras manifest fetch $ORAS_OPTIONS $URL@$DIGEST | jq --raw-output '.layers[0].digest')
561
563
echo "URL $URL DIGEST $DIGEST AARCHIVE $AARCHIVE"
562
- use-archive oci:$URL@$AARCHIVE=$(workspaces.source.path) /artifacts` , orasOptions , registryArgsWithDefaults (jbsConfig , "" ), BuildTaskName ),
564
+ use-archive oci:$URL@$AARCHIVE=%s /artifacts` , orasOptions , registryArgsWithDefaults (jbsConfig , "" ), BuildTaskName , PostBuildVolumeMount ),
563
565
},
564
566
{
565
567
Name : "verify-and-check-for-contaminates" ,
566
568
Image : buildRequestProcessorImage ,
567
569
ImagePullPolicy : pullPolicy ,
568
570
SecurityContext : & v1.SecurityContext {RunAsUser : & zero },
569
571
Env : secretVariables ,
570
- VolumeMounts : []v1.VolumeMount {{Name : PostBuildVolume , MountPath : WorkspaceMount }},
571
572
ComputeResources : v1.ResourceRequirements {
572
573
Requests : v1.ResourceList {"memory" : limits .defaultBuildRequestMemory , "cpu" : limits .defaultRequestCPU },
573
574
Limits : v1.ResourceList {"memory" : limits .defaultBuildRequestMemory , "cpu" : limits .defaultLimitCPU },
@@ -855,7 +856,7 @@ func verifyParameters(jbsConfig *v1alpha1.JBSConfig, recipe *v1alpha1.BuildRecip
855
856
verifyBuiltArtifactsArgs := []string {
856
857
"verify-built-artifacts" ,
857
858
"--repository-url=$(params." + PipelineParamProxyUrl + ")" ,
858
- "--deploy-path=$(workspaces.source.path) /artifacts" ,
859
+ fmt . Sprintf ( "--deploy-path=%s /artifacts" , PostBuildVolumeMount ) ,
859
860
"--task-run-name=$(context.taskRun.name)" ,
860
861
"--results-file=$(results." + PipelineResultPassedVerification + ".path)" ,
861
862
}
0 commit comments