Last active
December 16, 2021 22:55
-
-
Save karmab/984386da171340fddc680034bcc4a428 to your computer and use it in GitHub Desktop.
Tekton pipeline with two cloned repos
This file contains hidden or 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
apiVersion: tekton.dev/v1beta1 | |
kind: PipelineRun | |
metadata: | |
generateName: mysupertask | |
spec: | |
pipelineRef: | |
name: mysupertask | |
workspaces: | |
- name: sourcedir | |
volumeClaimTemplate: | |
metadata: | |
name: src-pvc | |
spec: | |
accessModes: ["ReadWriteOnce"] | |
resources: | |
requests: | |
storage: 1Gi | |
- name: confdir | |
volumeClaimTemplate: | |
metadata: | |
name: conf-pvc | |
spec: | |
accessModes: ["ReadWriteOnce"] | |
resources: | |
requests: | |
storage: 1Gi | |
params: | |
- name: arg1 | |
value: "pepe" |
This file contains hidden or 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
apiVersion: tekton.dev/v1beta1 | |
kind: Task | |
metadata: | |
name: mysupertask | |
spec: | |
workspaces: | |
- name: sourcedir | |
- name: confdir | |
params: | |
- name: arg1 | |
description: arg1 | |
type: string | |
steps: | |
- name: mytask1 | |
image: "quay.io/centos/centos:stream8" | |
env: | |
- name: ARG1 | |
value: $(params.arg1) | |
script: | | |
#!/usr/bin/env sh | |
echo $ARG1 | |
ls /workspace/sourcedir | |
ls /workspace/confdir | |
--- | |
apiVersion: tekton.dev/v1beta1 | |
kind: Pipeline | |
metadata: | |
name: mysupertask | |
spec: | |
description: mysupertask | |
params: | |
- name: arg1 | |
type: string | |
workspaces: | |
- name: sourcedir | |
- name: confdir | |
tasks: | |
- name: clone-sourcedir | |
taskRef: | |
name: git-clone | |
workspaces: | |
- name: output | |
workspace: sourcedir | |
params: | |
- name: url | |
value: https://github.com/karmab/kcli | |
- name: clone-confdir | |
taskRef: | |
name: git-clone | |
workspaces: | |
- name: output | |
workspace: confdir | |
params: | |
- name: url | |
value: https://github.com/karmab/kcli-plan-samples | |
- name: mysupertask | |
taskRef: | |
name: mysupertask | |
runAfter: | |
- clone-sourcedir | |
- clone-confdir | |
workspaces: | |
- name: sourcedir | |
workspace: sourcedir | |
- name: confdir | |
workspace: confdir | |
params: | |
- name: arg1 | |
value: $(params.arg1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment