-
Notifications
You must be signed in to change notification settings - Fork 133
Expand file tree
/
Copy pathtest-collect-charon-params-fail-no-snapshot.yaml
More file actions
108 lines (107 loc) · 3.62 KB
/
Copy pathtest-collect-charon-params-fail-no-snapshot.yaml
File metadata and controls
108 lines (107 loc) · 3.62 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
---
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
name: test-collect-charon-params-fail-no-snapshot
annotations:
test/assert-task-failure: "run-task"
spec:
description: |
Run the collect-charon-params task with no snapshot file and verify the taks fails as expected
params:
- name: ociStorage
description: The OCI repository where the Trusted Artifacts are stored.
type: string
- name: ociArtifactExpiresAfter
description: Expiration date for the trusted artifacts created in the
OCI repository. An empty string means the artifacts do not expire.
type: string
default: "1d"
- name: orasOptions
description: oras options to pass to Trusted Artifacts calls
type: string
default: "--insecure"
- name: trustedArtifactsDebug
description: Flag to enable debug logging in trusted artifacts. Set to a non-empty string to enable.
type: string
default: ""
- name: dataDir
description: The location where data will be stored
type: string
tasks:
- name: setup
taskSpec:
results:
- name: sourceDataArtifact
type: string
volumes:
- name: workdir
emptyDir: {}
stepTemplate:
volumeMounts:
- mountPath: /var/workdir
name: workdir
env:
- name: IMAGE_EXPIRES_AFTER
value: $(params.ociArtifactExpiresAfter)
- name: "ORAS_OPTIONS"
value: "$(params.orasOptions)"
- name: "DEBUG"
value: "$(params.trustedArtifactsDebug)"
steps:
- name: setup-values
image: quay.io/konflux-ci/release-service-utils@sha256:5546fa78d3c88d7b6a2e8cff8902f7757f00541d0bbaf113b9f293133894afa3
script: |
#!/usr/bin/env sh
set -eux
mkdir -p "$(params.dataDir)/$(context.pipelineRun.uid)"
cat > "$(params.dataDir)/$(context.pipelineRun.uid)/data.json" << EOF
{
"releaseNotes": {
"product_name": "test",
"product_version": "0.0.1"
},
"charon": {
"config":"charon-config",
"awsSecret": "charon-aws-credentials",
"environment": "dev",
"release": "ga"
}
}
EOF
- name: create-trusted-artifact
ref:
name: create-trusted-artifact
params:
- name: ociStorage
value: $(params.ociStorage)
- name: workDir
value: $(params.dataDir)
- name: sourceDataArtifact
value: $(results.sourceDataArtifact.path)
- name: run-task
taskRef:
name: collect-charon-params
params:
- name: dataJsonPath
value: $(context.pipelineRun.uid)/data.json
- name: snapshotPath
value: $(context.pipelineRun.uid)/snapshot_spec.json
- name: ociStorage
value: $(params.ociStorage)
- name: orasOptions
value: $(params.orasOptions)
- name: sourceDataArtifact
value: "$(tasks.setup.results.sourceDataArtifact)=$(params.dataDir)"
- name: dataDir
value: $(params.dataDir)
- name: trustedArtifactsDebug
value: $(params.trustedArtifactsDebug)
- name: taskGitUrl
value: "http://localhost"
- name: taskGitRevision
value: "main"
- name: releasePath
value: $(context.pipelineRun.uid)/release.json
runAfter:
- setup