-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add pipeline-params-from-tasks-results test
- Loading branch information
1 parent
d648372
commit d2263d9
Showing
4 changed files
with
447 additions
and
0 deletions.
There are no files selected for viewing
339 changes: 339 additions & 0 deletions
339
...config/inrepo/test_data/load_pipelinerun/pipeline-params-from-tasks-results/expected.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,339 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: PipelineRun | ||
metadata: | ||
creationTimestamp: null | ||
name: jx3-test-save-show-results | ||
spec: | ||
params: | ||
- name: value_to_save | ||
value: "" | ||
- name: BUILD_ID | ||
value: "" | ||
- name: JOB_NAME | ||
value: "" | ||
- name: JOB_SPEC | ||
value: "" | ||
- name: JOB_TYPE | ||
value: "" | ||
- name: PULL_BASE_REF | ||
value: "" | ||
- name: PULL_BASE_SHA | ||
value: "" | ||
- name: PULL_NUMBER | ||
value: "" | ||
- name: PULL_PULL_REF | ||
value: "" | ||
- name: PULL_PULL_SHA | ||
value: "" | ||
- name: PULL_REFS | ||
value: "" | ||
- name: REPO_NAME | ||
value: "" | ||
- name: REPO_OWNER | ||
value: "" | ||
- name: REPO_URL | ||
value: "" | ||
pipelineSpec: | ||
params: | ||
- default: "" | ||
name: value_to_save | ||
type: string | ||
- description: the unique build number | ||
name: BUILD_ID | ||
type: string | ||
- description: the name of the job which is the trigger context name | ||
name: JOB_NAME | ||
type: string | ||
- description: the specification of the job | ||
name: JOB_SPEC | ||
type: string | ||
- description: '''the kind of job: postsubmit or presubmit''' | ||
name: JOB_TYPE | ||
type: string | ||
- description: the base git reference of the pull request | ||
name: PULL_BASE_REF | ||
type: string | ||
- description: the git sha of the base of the pull request | ||
name: PULL_BASE_SHA | ||
type: string | ||
- default: "" | ||
description: git pull request number | ||
name: PULL_NUMBER | ||
type: string | ||
- default: "" | ||
description: git pull request ref in the form 'refs/pull/$PULL_NUMBER/head' | ||
name: PULL_PULL_REF | ||
type: string | ||
- default: "" | ||
description: git revision to checkout (branch, tag, sha, ref…) | ||
name: PULL_PULL_SHA | ||
type: string | ||
- description: git pull reference strings of base and latest in the form 'master:$PULL_BASE_SHA,$PULL_NUMBER:$PULL_PULL_SHA:refs/pull/$PULL_NUMBER/head' | ||
name: PULL_REFS | ||
type: string | ||
- description: git repository name | ||
name: REPO_NAME | ||
type: string | ||
- description: git repository owner (user or organisation) | ||
name: REPO_OWNER | ||
type: string | ||
- description: git url to clone | ||
name: REPO_URL | ||
type: string | ||
results: | ||
- description: result_value | ||
name: result_value | ||
value: $(tasks.save-results.results.result_value) | ||
tasks: | ||
- name: save-results | ||
params: | ||
- name: value_to_save | ||
value: test_demo | ||
- name: BUILD_ID | ||
value: $(params.BUILD_ID) | ||
- name: JOB_NAME | ||
value: $(params.JOB_NAME) | ||
- name: JOB_SPEC | ||
value: $(params.JOB_SPEC) | ||
- name: JOB_TYPE | ||
value: $(params.JOB_TYPE) | ||
- name: PULL_BASE_REF | ||
value: $(params.PULL_BASE_REF) | ||
- name: PULL_BASE_SHA | ||
value: $(params.PULL_BASE_SHA) | ||
- name: PULL_NUMBER | ||
value: $(params.PULL_NUMBER) | ||
- name: PULL_PULL_REF | ||
value: $(params.PULL_PULL_REF) | ||
- name: PULL_PULL_SHA | ||
value: $(params.PULL_PULL_SHA) | ||
- name: PULL_REFS | ||
value: $(params.PULL_REFS) | ||
- name: REPO_NAME | ||
value: $(params.REPO_NAME) | ||
- name: REPO_OWNER | ||
value: $(params.REPO_OWNER) | ||
- name: REPO_URL | ||
value: $(params.REPO_URL) | ||
taskSpec: | ||
metadata: {} | ||
params: | ||
- default: "" | ||
name: value_to_save | ||
type: string | ||
- description: the unique build number | ||
name: BUILD_ID | ||
type: string | ||
- description: the name of the job which is the trigger context name | ||
name: JOB_NAME | ||
type: string | ||
- description: the specification of the job | ||
name: JOB_SPEC | ||
type: string | ||
- description: '''the kind of job: postsubmit or presubmit''' | ||
name: JOB_TYPE | ||
type: string | ||
- description: the base git reference of the pull request | ||
name: PULL_BASE_REF | ||
type: string | ||
- description: the git sha of the base of the pull request | ||
name: PULL_BASE_SHA | ||
type: string | ||
- default: "" | ||
description: git pull request number | ||
name: PULL_NUMBER | ||
type: string | ||
- default: "" | ||
description: git pull request ref in the form 'refs/pull/$PULL_NUMBER/head' | ||
name: PULL_PULL_REF | ||
type: string | ||
- default: "" | ||
description: git revision to checkout (branch, tag, sha, ref…) | ||
name: PULL_PULL_SHA | ||
type: string | ||
- description: git pull reference strings of base and latest in the form 'master:$PULL_BASE_SHA,$PULL_NUMBER:$PULL_PULL_SHA:refs/pull/$PULL_NUMBER/head' | ||
name: PULL_REFS | ||
type: string | ||
- description: git repository name | ||
name: REPO_NAME | ||
type: string | ||
- description: git repository owner (user or organisation) | ||
name: REPO_OWNER | ||
type: string | ||
- description: git url to clone | ||
name: REPO_URL | ||
type: string | ||
results: | ||
- description: result_value | ||
name: result_value | ||
spec: null | ||
stepTemplate: | ||
env: | ||
- name: BUILD_ID | ||
value: $(params.BUILD_ID) | ||
- name: JOB_NAME | ||
value: $(params.JOB_NAME) | ||
- name: JOB_SPEC | ||
value: $(params.JOB_SPEC) | ||
- name: JOB_TYPE | ||
value: $(params.JOB_TYPE) | ||
- name: PULL_BASE_REF | ||
value: $(params.PULL_BASE_REF) | ||
- name: PULL_BASE_SHA | ||
value: $(params.PULL_BASE_SHA) | ||
- name: PULL_NUMBER | ||
value: $(params.PULL_NUMBER) | ||
- name: PULL_PULL_REF | ||
value: $(params.PULL_PULL_REF) | ||
- name: PULL_PULL_SHA | ||
value: $(params.PULL_PULL_SHA) | ||
- name: PULL_REFS | ||
value: $(params.PULL_REFS) | ||
- name: REPO_NAME | ||
value: $(params.REPO_NAME) | ||
- name: REPO_OWNER | ||
value: $(params.REPO_OWNER) | ||
- name: REPO_URL | ||
value: $(params.REPO_URL) | ||
imagePullPolicy: IfNotPresent | ||
name: "" | ||
resources: {} | ||
workingDir: /workspace/source | ||
steps: | ||
- image: ubuntu:jammy | ||
name: save-result | ||
resources: {} | ||
script: | | ||
#!/usr/bin/env sh | ||
set -ex | ||
result_value="$(params.value_to_save)" | ||
echo "results.result_value.path is $(results.result_value.path)" | ||
echo -n "${result_value}" > $(results.result_value.path) | ||
echo "result_value is ${result_value}" | ||
- name: display-results | ||
params: | ||
- name: value_to_show | ||
value: $(tasks.save-results.results.result_value) | ||
- name: BUILD_ID | ||
value: $(params.BUILD_ID) | ||
- name: JOB_NAME | ||
value: $(params.JOB_NAME) | ||
- name: JOB_SPEC | ||
value: $(params.JOB_SPEC) | ||
- name: JOB_TYPE | ||
value: $(params.JOB_TYPE) | ||
- name: PULL_BASE_REF | ||
value: $(params.PULL_BASE_REF) | ||
- name: PULL_BASE_SHA | ||
value: $(params.PULL_BASE_SHA) | ||
- name: PULL_NUMBER | ||
value: $(params.PULL_NUMBER) | ||
- name: PULL_PULL_REF | ||
value: $(params.PULL_PULL_REF) | ||
- name: PULL_PULL_SHA | ||
value: $(params.PULL_PULL_SHA) | ||
- name: PULL_REFS | ||
value: $(params.PULL_REFS) | ||
- name: REPO_NAME | ||
value: $(params.REPO_NAME) | ||
- name: REPO_OWNER | ||
value: $(params.REPO_OWNER) | ||
- name: REPO_URL | ||
value: $(params.REPO_URL) | ||
runAfter: | ||
- save-results | ||
taskSpec: | ||
metadata: {} | ||
params: | ||
- default: "" | ||
name: value_to_show | ||
type: string | ||
- description: the unique build number | ||
name: BUILD_ID | ||
type: string | ||
- description: the name of the job which is the trigger context name | ||
name: JOB_NAME | ||
type: string | ||
- description: the specification of the job | ||
name: JOB_SPEC | ||
type: string | ||
- description: '''the kind of job: postsubmit or presubmit''' | ||
name: JOB_TYPE | ||
type: string | ||
- description: the base git reference of the pull request | ||
name: PULL_BASE_REF | ||
type: string | ||
- description: the git sha of the base of the pull request | ||
name: PULL_BASE_SHA | ||
type: string | ||
- default: "" | ||
description: git pull request number | ||
name: PULL_NUMBER | ||
type: string | ||
- default: "" | ||
description: git pull request ref in the form 'refs/pull/$PULL_NUMBER/head' | ||
name: PULL_PULL_REF | ||
type: string | ||
- default: "" | ||
description: git revision to checkout (branch, tag, sha, ref…) | ||
name: PULL_PULL_SHA | ||
type: string | ||
- description: git pull reference strings of base and latest in the form 'master:$PULL_BASE_SHA,$PULL_NUMBER:$PULL_PULL_SHA:refs/pull/$PULL_NUMBER/head' | ||
name: PULL_REFS | ||
type: string | ||
- description: git repository name | ||
name: REPO_NAME | ||
type: string | ||
- description: git repository owner (user or organisation) | ||
name: REPO_OWNER | ||
type: string | ||
- description: git url to clone | ||
name: REPO_URL | ||
type: string | ||
spec: null | ||
stepTemplate: | ||
env: | ||
- name: BUILD_ID | ||
value: $(params.BUILD_ID) | ||
- name: JOB_NAME | ||
value: $(params.JOB_NAME) | ||
- name: JOB_SPEC | ||
value: $(params.JOB_SPEC) | ||
- name: JOB_TYPE | ||
value: $(params.JOB_TYPE) | ||
- name: PULL_BASE_REF | ||
value: $(params.PULL_BASE_REF) | ||
- name: PULL_BASE_SHA | ||
value: $(params.PULL_BASE_SHA) | ||
- name: PULL_NUMBER | ||
value: $(params.PULL_NUMBER) | ||
- name: PULL_PULL_REF | ||
value: $(params.PULL_PULL_REF) | ||
- name: PULL_PULL_SHA | ||
value: $(params.PULL_PULL_SHA) | ||
- name: PULL_REFS | ||
value: $(params.PULL_REFS) | ||
- name: REPO_NAME | ||
value: $(params.REPO_NAME) | ||
- name: REPO_OWNER | ||
value: $(params.REPO_OWNER) | ||
- name: REPO_URL | ||
value: $(params.REPO_URL) | ||
imagePullPolicy: IfNotPresent | ||
name: "" | ||
resources: {} | ||
workingDir: /workspace/source | ||
steps: | ||
- image: ubuntu:jammy | ||
name: show-result | ||
resources: {} | ||
script: | | ||
#!/usr/bin/env sh | ||
set -ex | ||
echo "tasks.save-results.results.result_value is $(tasks.save-results.results.result_value)" | ||
value_to_show="$(params.value_to_show)" | ||
echo "value_to_show is ${value_to_show}" | ||
podTemplate: {} | ||
serviceAccountName: tekton-bot | ||
timeout: 30m0s | ||
status: {} |
30 changes: 30 additions & 0 deletions
30
...repo/test_data/load_pipelinerun/pipeline-params-from-tasks-results/save-results-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,30 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: save-results | ||
labels: | ||
app.kubernetes.io/version: "0.1" | ||
spec: | ||
params: | ||
- name: value_to_save | ||
type: string | ||
default: "" | ||
results: | ||
- name: "result_value" | ||
description: "result_value" | ||
stepTemplate: | ||
imagePullPolicy: IfNotPresent | ||
resources: | ||
# override limits for all containers here | ||
limits: {} | ||
workingDir: /workspace/source | ||
steps: | ||
- name: save-result | ||
image: ubuntu:jammy | ||
script: | | ||
#!/usr/bin/env sh | ||
set -ex | ||
result_value="$(params.value_to_save)" | ||
echo "results.result_value.path is $(results.result_value.path)" | ||
echo -n "${result_value}" > $(results.result_value.path) | ||
echo "result_value is ${result_value}" |
26 changes: 26 additions & 0 deletions
26
...repo/test_data/load_pipelinerun/pipeline-params-from-tasks-results/show-results-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,26 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: show-results | ||
labels: | ||
app.kubernetes.io/version: "0.1" | ||
spec: | ||
params: | ||
- name: value_to_show | ||
type: string | ||
default: "" | ||
stepTemplate: | ||
imagePullPolicy: IfNotPresent | ||
resources: | ||
# override limits for all containers here | ||
limits: {} | ||
workingDir: /workspace/source | ||
steps: | ||
- name: show-result | ||
image: ubuntu:jammy | ||
script: | | ||
#!/usr/bin/env sh | ||
set -ex | ||
echo "tasks.save-results.results.result_value is $(tasks.save-results.results.result_value)" | ||
value_to_show="$(params.value_to_show)" | ||
echo "value_to_show is ${value_to_show}" |
Oops, something went wrong.