diff --git a/examples/pipeline-go.yaml b/examples/pipeline-go.yaml index 1ae2bdace..e20dad4fe 100644 --- a/examples/pipeline-go.yaml +++ b/examples/pipeline-go.yaml @@ -25,6 +25,7 @@ spec: default: "false" workspaces: - name: source + - name: docker tasks: - displayName: Build go application name: build-task @@ -75,9 +76,11 @@ spec: value: $(workspaces.source.path)/cache - name: workingdir value: $(workspaces.source.path)/repo - - image: $(params.image) + - name: docker-config + value: $(workspaces.docker.path) + - name: run-go-build workingDir: $(workspaces.source.path)/repo - name: run-go-build + image: $(params.image) env: - name: GOCACHE value: $(workspaces.source.path)/cache/gocache @@ -103,5 +106,7 @@ spec: value: $(workspaces.source.path)/cache - name: workingdir value: $(workspaces.source.path)/repo + - name: docker-config + value: $(workspaces.docker.path) - name: force-cache-upload - value: $(params.force-cache-upload) + value: $(params.force-cache-upload) \ No newline at end of file diff --git a/examples/pipelinerun-go.yaml b/examples/pipelinerun-go.yaml index 26b869113..d7d1b2f29 100644 --- a/examples/pipelinerun-go.yaml +++ b/examples/pipelinerun-go.yaml @@ -21,5 +21,8 @@ spec: - name: image value: golang:1.21 workspaces: + - name: docker + secret: + secretName: regcred - name: source emptyDir: {} diff --git a/tekton/cache-fetch.yaml b/tekton/cache-fetch.yaml index 8fe9a3809..16496c43a 100644 --- a/tekton/cache-fetch.yaml +++ b/tekton/cache-fetch.yaml @@ -38,6 +38,11 @@ spec: The path where to find the google credentials. If left empty, it is ignored. type: string default: "" + - name: docker-config + description: | + The path where to find the docker config.json file. If left empty, it is ignored. + type: string + default: "/workspace/docker" results: # Any result to "publish" ? - name: fetched description: | @@ -53,6 +58,9 @@ spec: value: $(params.insecure) - name: GOOGLE_APPLICATION_CREDENTIALS value: $(params.googleCredentialsPath) + - name: DOCKER_CONFIG + value: $(params.docker-config) + # FIXME: use a released version once something is released :) image: ghcr.io/openshift-pipelines/tekton-caches/cache:latest args: ["$(params.patterns[*])"] diff --git a/tekton/cache-upload.yaml b/tekton/cache-upload.yaml index 4f8c70785..74618d4ff 100644 --- a/tekton/cache-upload.yaml +++ b/tekton/cache-upload.yaml @@ -48,6 +48,11 @@ spec: The path where to find the google credentials. If left empty, it is ignored. type: string default: "" + - name: docker-config + description: | + The path where to find the docker config.json file. If left empty, it is ignored. + type: string + default: "/workspace/docker" env: - name: PARAM_TARGET value: $(params.target) @@ -63,6 +68,8 @@ spec: value: $(params.force-cache-upload) - name: GOOGLE_APPLICATION_CREDENTIALS value: $(params.googleCredentialsPath) + - name: DOCKER_CONFIG + value: $(params.docker-config) # FIXME: use a released version once something is released :) image: ghcr.io/openshift-pipelines/tekton-caches/cache:latest args: ["$(params.patterns[*])"]