Skip to content

Commit 84e3b6e

Browse files
authored
Merge pull request #68 from averevki/rp-import-attributes
Add ocp version and description to RP import task
2 parents 20d04f2 + b2de8c2 commit 84e3b6e

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

main/pipeline.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ spec:
3939
description: Prefix of the launch name saved in report portal (nightly, username, manual, etc.)
4040
name: launch-name
4141
type: string
42+
- default: ""
43+
description: Optional launch description for Report Portal
44+
name: launch-description
45+
type: string
4246
- default: testsuite
4347
description: Report Portal Project to store test results (e.g. testsuite, nightly-testsuite)
4448
name: rp-project
@@ -95,12 +99,16 @@ spec:
9599
params:
96100
- name: launch-name
97101
value: $(params.launch-name)
102+
- name: launch-description
103+
value: $(params.launch-description)
98104
- name: testsuite-image
99105
value: $(params.testsuite-image)
100106
- name: make-target
101107
value: $(params.make-target)
102108
- name: rp-project
103109
value: $(params.rp-project)
110+
- name: ocp-version
111+
value: $(tasks.kubectl-login.results.ocp-version)
104112
taskRef:
105113
kind: Task
106114
name: upload-results

nightly/pipeline.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ spec:
4242
description: Prefix of the launch name saved in report portal (nightly, username, manual, etc.)
4343
name: launch-name
4444
type: string
45+
- default: ""
46+
description: Optional launch description for Report Portal
47+
name: launch-description
48+
type: string
4549
- default: nightly-testsuite
4650
description: Report Portal Project to store test results (e.g. testsuite, nightly-testsuite)
4751
name: rp-project
@@ -212,12 +216,16 @@ spec:
212216
params:
213217
- name: launch-name
214218
value: $(params.launch-name)
219+
- name: launch-description
220+
value: $(params.launch-description)
215221
- name: testsuite-image
216222
value: $(params.testsuite-image)
217223
- name: make-target
218224
value: all
219225
- name: rp-project
220226
value: $(params.rp-project)
227+
- name: ocp-version
228+
value: $(tasks.kubectl-login.results.ocp-version)
221229
taskRef:
222230
kind: Task
223231
name: upload-results

tasks/login/kubectl-login-task.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ spec:
1616
results:
1717
- name: kubeconfig-path
1818
description: Path to new kubeconfig in the workspace
19+
- name: ocp-version
20+
description: OCP cluster version
1921
steps:
2022
- args:
2123
- >-
@@ -27,7 +29,9 @@ spec:
2729
kubectl config set-credentials user --token=${TOKEN} &&
2830
kubectl config set-context ctx --user=user --cluster=ctx &&
2931
kubectl config use-context ctx &&
30-
echo -n ${KUBECONFIG} | tee $(results.kubeconfig-path.path)
32+
echo -n ${KUBECONFIG} | tee $(results.kubeconfig-path.path) &&
33+
export OCP_VERSION=$(kubectl get clusterversion -o jsonpath='{.items[].status.history[0].version}') &&
34+
echo -n ${OCP_VERSION%.*} | tee $(results.ocp-version.path)
3135
command:
3236
- /bin/bash
3337
- -cveo

tasks/upload-results-task.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ spec:
77
- description: Prefix of the launch name saved in report portal (nightly, username, manual, etc.)
88
name: launch-name
99
type: string
10+
- description: Launch description for Report Portal
11+
name: launch-description
12+
type: string
1013
- description: Testsuite image to run tests on
1114
name: testsuite-image
1215
type: string
@@ -16,6 +19,9 @@ spec:
1619
- description: Report Portal Project to store test results
1720
name: rp-project
1821
type: string
22+
- description: OCP cluster version
23+
name: ocp-version
24+
type: string
1925
steps:
2026
- args:
2127
- make reportportal
@@ -46,6 +52,10 @@ spec:
4652
name: rp-credentials
4753
- name: REQUESTS_CA_BUNDLE
4854
value: /var/ca-bundle/tls-ca-bundle.pem
55+
- name: RP_LAUNCH_DESC
56+
value: $(params.launch-description)
57+
- name: OCP_VERSION
58+
value: $(params.ocp-version)
4959
image: $(params.testsuite-image)
5060
imagePullPolicy: Always
5161
name: upload-results

0 commit comments

Comments
 (0)