-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kind/feat: passing artifacts between tasks
- Loading branch information
1 parent
7f6c6ec
commit d345e99
Showing
39 changed files
with
1,799 additions
and
246 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
60 changes: 60 additions & 0 deletions
60
examples/v1/pipelineruns/alpha/consume-artifacts-from-task.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
apiVersion: tekton.dev/v1 | ||
kind: PipelineRun | ||
metadata: | ||
generateName: pipelinerun-consume-tasks-artifacts | ||
spec: | ||
pipelineSpec: | ||
tasks: | ||
- name: produce-artifacts-task | ||
taskSpec: | ||
description: | | ||
A simple task that produces artifacts | ||
steps: | ||
- name: produce-artifacts | ||
image: bash:latest | ||
script: | | ||
#!/usr/bin/env bash | ||
cat > $(artifacts.path) << EOF | ||
{ | ||
"inputs":[ | ||
{ | ||
"name":"input-artifacts", | ||
"values":[ | ||
{ | ||
"uri":"pkg:example.github.com/inputs", | ||
"digest":{ | ||
"sha256":"b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0" | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"outputs":[ | ||
{ | ||
"name":"image", | ||
"values":[ | ||
{ | ||
"uri":"pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c", | ||
"digest":{ | ||
"sha256":"df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48", | ||
"sha1":"95588b8f34c31eb7d62c92aaa4e6506639b06ef2" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
EOF | ||
- name: consume-artifacts | ||
runAfter: | ||
- produce-artifacts-task | ||
taskSpec: | ||
steps: | ||
- name: artifacts-consumer-python | ||
image: python:latest | ||
script: | | ||
#!/usr/bin/env python3 | ||
import json | ||
data = json.loads('$(tasks.produce-artifacts-task.outputs.image)') | ||
if data[0]['uri'] != "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c": | ||
exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
apiVersion: tekton.dev/v1 | ||
kind: TaskRun | ||
metadata: | ||
generateName: task-run-artifacts | ||
spec: | ||
taskSpec: | ||
description: | | ||
A simple task that produces artifacts | ||
steps: | ||
- name: produce-artifacts | ||
image: bash:latest | ||
script: | | ||
#!/usr/bin/env bash | ||
cat > $(artifacts.path) << EOF | ||
{ | ||
"inputs":[ | ||
{ | ||
"name":"input-artifacts", | ||
"values":[ | ||
{ | ||
"uri":"pkg:example.github.com/inputs", | ||
"digest":{ | ||
"sha256":"b35cacccfdb1e24dc497d15d553891345fd155713ffe647c281c583269eaaae0" | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"outputs":[ | ||
{ | ||
"name":"image", | ||
"values":[ | ||
{ | ||
"uri":"pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c", | ||
"digest":{ | ||
"sha256":"df85b9e3983fe2ce20ef76ad675ecf435cc99fc9350adc54fa230bae8c32ce48", | ||
"sha1":"95588b8f34c31eb7d62c92aaa4e6506639b06ef2" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,6 @@ const ( | |
StepsDir = "/tekton/steps" | ||
|
||
ScriptDir = "/tekton/scripts" | ||
|
||
ArtifactsDir = "/tekton/artifacts" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.