-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ISV-3903] Add tekton task to check the status of running prow jobs (#…
…485)
- Loading branch information
Showing
4 changed files
with
151 additions
and
67 deletions.
There are no files selected for viewing
This file contains 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
67 changes: 67 additions & 0 deletions
67
ansible/roles/operator-pipeline/templates/openshift/tasks/wait-prow-tests.yml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: wait-prow-tests | ||
spec: | ||
description: Wait for the termination of all prow tests. | ||
|
||
params: | ||
- name: pipeline_image | ||
description: The common pipeline image. | ||
|
||
- name: supported_ocp_versions | ||
description: | | ||
Space separated list of ocp versions supported by the pipeline | ||
and the bundle | ||
- name: github_host_url | ||
description: | | ||
The GitHub host, adjust this if you run a GitHub enterprise. | ||
default: "https://api.github.com" | ||
|
||
- name: request_url | ||
description: | | ||
The GitHub issue or pull request URL where we want to add a new | ||
comment. | ||
- name: github_token_secret_name | ||
description: | | ||
The name of the Kubernetes Secret that contains the GitHub token. | ||
default: github | ||
|
||
- name: github_token_secret_key | ||
description: | | ||
The key within the Kubernetes Secret that contains the GitHub token. | ||
default: token | ||
|
||
steps: | ||
- name: poll-pr-labels | ||
image: "$(params.pipeline_image)" | ||
env: | ||
- name: GITHUB_TOKEN | ||
valueFrom: | ||
secretKeyRef: | ||
name: "$(params.github_token_secret_name)" | ||
key: "$(params.github_token_secret_key)" | ||
script: | | ||
#!/usr/bin/env bash | ||
set -xe | ||
expected_labels="" | ||
for version in $(params.supported_ocp_versions); do | ||
expected_labels="${expected_labels} --any ocp/${version//./\\.}/(pass|fail)" | ||
done | ||
echo "Waiting for prow tests to finish..." | ||
github-wait-labels \ | ||
--github-host-url "$(params.github_host_url)" \ | ||
--pull-request-url "$(params.request_url)" \ | ||
${expected_labels} \ | ||
--poll-interval 30 \ | ||
--timeout 3600 \ | ||
--verbose \ | ||
>/tmp/labels || exit 1 | ||
grep -E 'ocp/[^/]+/fail' /tmp/labels && exit 1 || exit 0 |
This file contains 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
This file contains 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