forked from tektoncd/catalog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.yaml
71 lines (71 loc) · 1.74 KB
/
run.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: yq-pipeline
spec:
params:
- name: new-image-sha
description: example of a value to use
default: "123"
workspaces:
- name: source
tasks:
- name: fetch-repository
taskRef:
name: git-clone
workspaces:
- name: output
workspace: source
params:
- name: url
value: https://github.com/GijsvanDulmen/yq-task-test
- name: revision
value: "main"
- name: subdirectory
value: ""
- name: deleteExisting
value: "true"
- name: yq-replace
taskRef:
name: yq
runAfter:
- fetch-repository
workspaces:
- name: source
workspace: source
params:
- name: SCRIPT
value: |
for var in "./helm/values.yaml" "./helm/values-development.yaml"
do
/usr/bin/yq eval -i '.image="012345my-new-image-sha"' "$var"
done
finally:
- name: display-results
workspaces:
- name: source
workspace: source
taskSpec:
workspaces:
- name: source
steps:
- name: print
image: docker.io/library/bash:5.1.4@sha256:b208215a4655538be652b2769d82e576bc4d0a2bb132144c060efc5be8c3f5d6
script: |
#!/usr/bin/env bash
set -e
cat $(workspaces.source.path)/helm/values.yaml
cat $(workspaces.source.path)/helm/values-development.yaml
---
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: yq-pipeline-run
spec:
pipelineRef:
name: yq-pipeline
workspaces:
- name: source
persistentvolumeclaim:
claimName: yq-pvc