@@ -19,10 +19,10 @@ import (
1919)
2020
2121const (
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"
2626
2727 GitTaskName = "git-clone"
2828 PreBuildTaskName = "pre-build"
@@ -138,8 +138,8 @@ func createPipelineSpec(log logr.Logger, tool string, commitTime int64, jbsConfi
138138 verifyBuiltArtifactsArgs := verifyParameters (jbsConfig , recipe )
139139 deployArgs := []string {
140140 "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 ) ,
143143 "--task-run-name=$(context.taskRun.name)" ,
144144 "--build-id=" + buildId ,
145145 "--scm-uri=" + db .Spec .ScmInfo .SCMURL ,
@@ -543,31 +543,32 @@ func createPipelineSpec(log logr.Logger, tool string, commitTime int64, jbsConfi
543543 {Name : PipelineResultPassedVerification },
544544 {Name : PipelineResultVerificationResult },
545545 },
546+ StepTemplate : & tektonpipeline.StepTemplate {
547+ VolumeMounts : []v1.VolumeMount {{Name : PostBuildVolume , MountPath : PostBuildVolumeMount }},
548+ },
546549 Steps : []tektonpipeline.Step {
547550 {
548551 Name : "restore-post-build-artifacts" ,
549- VolumeMounts : []v1.VolumeMount {{Name : PostBuildVolume , MountPath : WorkspaceMount }},
550552 Image : strings .TrimSpace (strings .Split (buildTrustedArtifacts , "FROM" )[1 ]),
551553 ImagePullPolicy : v1 .PullIfNotPresent ,
552554 SecurityContext : & v1.SecurityContext {RunAsUser : & zero },
553555 Env : secretVariables ,
554556 // While the manifest digest is available we need the manifest of the layer within the archive hence
555557 // 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"
557559export ORAS_OPTIONS="%s"
558560URL=%s
559561DIGEST=$(tasks.%s.results.IMAGE_DIGEST)
560562AARCHIVE=$(oras manifest fetch $ORAS_OPTIONS $URL@$DIGEST | jq --raw-output '.layers[0].digest')
561563echo "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 ),
563565 },
564566 {
565567 Name : "verify-and-check-for-contaminates" ,
566568 Image : buildRequestProcessorImage ,
567569 ImagePullPolicy : pullPolicy ,
568570 SecurityContext : & v1.SecurityContext {RunAsUser : & zero },
569571 Env : secretVariables ,
570- VolumeMounts : []v1.VolumeMount {{Name : PostBuildVolume , MountPath : WorkspaceMount }},
571572 ComputeResources : v1.ResourceRequirements {
572573 Requests : v1.ResourceList {"memory" : limits .defaultBuildRequestMemory , "cpu" : limits .defaultRequestCPU },
573574 Limits : v1.ResourceList {"memory" : limits .defaultBuildRequestMemory , "cpu" : limits .defaultLimitCPU },
@@ -855,7 +856,7 @@ func verifyParameters(jbsConfig *v1alpha1.JBSConfig, recipe *v1alpha1.BuildRecip
855856 verifyBuiltArtifactsArgs := []string {
856857 "verify-built-artifacts" ,
857858 "--repository-url=$(params." + PipelineParamProxyUrl + ")" ,
858- "--deploy-path=$(workspaces.source.path) /artifacts" ,
859+ fmt . Sprintf ( "--deploy-path=%s /artifacts" , PostBuildVolumeMount ) ,
859860 "--task-run-name=$(context.taskRun.name)" ,
860861 "--results-file=$(results." + PipelineResultPassedVerification + ".path)" ,
861862 }
0 commit comments