-
Notifications
You must be signed in to change notification settings - Fork 133
Expand file tree
/
Copy pathclose-advisory-issues.yaml
More file actions
166 lines (164 loc) · 5.42 KB
/
Copy pathclose-advisory-issues.yaml
File metadata and controls
166 lines (164 loc) · 5.42 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
---
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: close-advisory-issues
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tekton.dev/tags: release
spec:
description: >
Tekton task to close all issues referenced in the releaseNotes. It is meant to run after the advisory is published.
A comment will be added to each closed issue with a link to the advisory it was fixed in.
Note: This task currently only supports issues in redhat.atlassian.net and issues.redhat.com due to them requiring
authentication. Issues in other servers will be skipped without the task failing.
params:
- name: dataPath
description: Path to the JSON string of the merged data to use in the data workspace
type: string
- name: advisoryUrl
description: The url of the advisory the issues were fixed in. This is added in a comment on the issue
type: string
- name: ociStorage
description: The OCI repository where the Trusted Artifacts are stored
type: string
default: "empty"
- 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: trustedArtifactsDebug
description: Flag to enable debug logging in trusted artifacts. Set to a non-empty string to enable
type: string
default: ""
- name: orasOptions
description: oras options to pass to Trusted Artifacts calls
type: string
default: ""
- name: sourceDataArtifact
type: string
description: Location of trusted artifacts to be used to populate data directory
default: ""
- name: dataDir
description: The location where data will be stored
type: string
default: /var/workdir/release
- name: taskGitUrl
type: string
description: The url to the git repo where the release-service-catalog tasks and stepactions to be used are stored
- name: taskGitRevision
type: string
description: The revision in the taskGitUrl repo to be used
- name: caTrustConfigMapName
type: string
description: The name of the ConfigMap to read CA bundle data from
default: trusted-ca
- name: caTrustConfigMapKey
type: string
description: The name of the key in the ConfigMap that contains the CA bundle data
default: ca-bundle.crt
- name: jiraSecretName
type: string
description: The name of the secret to use for Jira authentication, containing one key - token
default: konflux-advisory-jira-secret
results:
- description: Produced trusted data artifact
name: sourceDataArtifact
type: string
volumes:
- name: workdir
emptyDir: {}
- name: access-token-secret-vol
secret:
secretName: $(params.jiraSecretName)
defaultMode: 0444
- name: trusted-ca
configMap:
name: $(params.caTrustConfigMapName)
items:
- key: $(params.caTrustConfigMapKey)
path: ca-bundle.crt
optional: true
stepTemplate:
volumeMounts:
- mountPath: /var/workdir
name: workdir
- name: trusted-ca
mountPath: /mnt/trusted-ca
readOnly: true
env:
- name: IMAGE_EXPIRES_AFTER
value: $(params.ociArtifactExpiresAfter)
- name: "ORAS_OPTIONS"
value: "$(params.orasOptions)"
- name: "DEBUG"
value: "$(params.trustedArtifactsDebug)"
securityContext:
runAsUser: 1001
steps:
- name: use-trusted-artifact
computeResources:
limits:
memory: 64Mi
requests:
memory: 64Mi
cpu: 30m
ref:
resolver: "git"
params:
- name: url
value: $(params.taskGitUrl)
- name: revision
value: $(params.taskGitRevision)
- name: pathInRepo
value: stepactions/use-trusted-artifact/use-trusted-artifact.yaml
params:
- name: workDir
value: $(params.dataDir)
- name: sourceDataArtifact
value: $(params.sourceDataArtifact)
- name: close-issues
image: quay.io/jbieren/release-service-utils:closeissues_2
computeResources:
limits:
memory: 128Mi
requests:
memory: 128Mi
cpu: 100m
volumeMounts:
- name: access-token-secret-vol
mountPath: "/etc/secrets"
env:
- name: PARAM_DATA_DIR
value: $(params.dataDir)
- name: PARAM_DATA_PATH
value: $(params.dataPath)
- name: PARAM_ADVISORY_URL
value: $(params.advisoryUrl)
- name: JIRA_SECRET_PATH
value: /etc/secrets
command: ["/home/scripts/python/tasks/managed/close_advisory_issues.py"]
- name: create-trusted-artifact
computeResources:
limits:
memory: 128Mi
requests:
memory: 128Mi
cpu: 250m
ref:
resolver: "git"
params:
- name: url
value: $(params.taskGitUrl)
- name: revision
value: $(params.taskGitRevision)
- name: pathInRepo
value: stepactions/create-trusted-artifact/create-trusted-artifact.yaml
params:
- name: ociStorage
value: $(params.ociStorage)
- name: workDir
value: $(params.dataDir)
- name: sourceDataArtifact
value: $(results.sourceDataArtifact.path)