Skip to content

Commit eddd7d0

Browse files
authored
Merge pull request #652 from snyk/chore/delete-operators-after-tests
chore: delete Operators from Quay after tests complete
2 parents e142d74 + 9bb5d28 commit eddd7d0

File tree

3 files changed

+44
-10
lines changed

3 files changed

+44
-10
lines changed

.circleci/config.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,21 @@ jobs:
109109
name: Notify Slack on failure
110110
when: on_fail
111111
working_directory: ~/kubernetes-monitor
112+
delete_operators_from_quay:
113+
docker:
114+
- auth:
115+
password: $DOCKERHUB_PASSWORD
116+
username: $DOCKERHUB_USER
117+
image: circleci/python:3.9
118+
steps:
119+
- checkout
120+
- install_python_requests
121+
- run:
122+
command: |
123+
python3 scripts/operator/delete_operators_from_quay.py "${QUAY_USERNAME}" "${QUAY_PASSWORD}"
124+
name: Delete Operators from Quay
125+
when: always
126+
working_directory: ~/kubernetes-monitor
112127
deploy_dev:
113128
docker:
114129
- auth:
@@ -334,11 +349,6 @@ jobs:
334349
export KUBERNETES_MONITOR_IMAGE_NAME_AND_TAG=$(./scripts/circleci-jobs/setup-integration-tests.py)
335350
.circleci/do-exclusively --branch staging --job ${CIRCLE_JOB} npm run test:integration:openshift4:operator
336351
name: Integration tests OpenShift 4
337-
- run:
338-
command: |
339-
scripts/operator/delete_operators_from_quay.py "${QUAY_USERNAME}" "${QUAY_PASSWORD}"
340-
name: Delete Operators from Quay
341-
when: always
342352
- run:
343353
command: |
344354
./scripts/slack/notify_failure_on_branch.py "${CIRCLE_BRANCH}" "${CIRCLE_JOB}" "${CIRCLE_BUILD_URL}" "${CIRCLE_PULL_REQUEST}" "${SLACK_WEBHOOK}"
@@ -946,6 +956,14 @@ workflows:
946956
requires:
947957
- build_image
948958
- build_and_upload_operator
959+
- delete_operators_from_quay:
960+
filters:
961+
branches:
962+
only:
963+
- staging
964+
requires:
965+
- integration_tests_operator_on_k8s
966+
- openshift4_integration_tests
949967
- tag_and_push:
950968
filters:
951969
branches:

.circleci/config/@config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ workflows:
7979
- build_image
8080
- build_and_upload_operator
8181
<<: *staging_branch_only_filter
82+
- delete_operators_from_quay:
83+
requires:
84+
- integration_tests_operator_on_k8s
85+
- openshift4_integration_tests
86+
<<: *staging_branch_only_filter
8287
- tag_and_push:
8388
requires:
8489
- build_image

.circleci/config/jobs/@jobs.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,6 @@ openshift4_integration_tests:
286286
command: |
287287
export KUBERNETES_MONITOR_IMAGE_NAME_AND_TAG=$(./scripts/circleci-jobs/setup-integration-tests.py)
288288
.circleci/do-exclusively --branch staging --job ${CIRCLE_JOB} npm run test:integration:openshift4:operator
289-
- run:
290-
name: Delete Operators from Quay
291-
command: |
292-
scripts/operator/delete_operators_from_quay.py "${QUAY_USERNAME}" "${QUAY_PASSWORD}"
293-
when: always
294289
- run:
295290
name: Notify Slack on failure
296291
command: |
@@ -299,6 +294,22 @@ openshift4_integration_tests:
299294
- store_artifacts:
300295
path: /tmp/logs/test/integration/openshift4
301296

297+
delete_operators_from_quay:
298+
docker:
299+
- image: circleci/python:3.9
300+
auth:
301+
username: $DOCKERHUB_USER
302+
password: $DOCKERHUB_PASSWORD
303+
working_directory: ~/kubernetes-monitor
304+
steps:
305+
- checkout
306+
- install_python_requests
307+
- run:
308+
name: Delete Operators from Quay
309+
command: |
310+
python3 scripts/operator/delete_operators_from_quay.py "${QUAY_USERNAME}" "${QUAY_PASSWORD}"
311+
when: always
312+
302313
######################## MERGE TO STAGING ########################
303314
tag_and_push:
304315
docker:

0 commit comments

Comments
 (0)