Skip to content

Commit 85868c5

Browse files
committed
chore: use a script to prepare integration tests in CI jobs
The repeating element appears several times in the CircleCI jobs. Currently it is extracted out in the OpenShift 3 job setup and it can be reused for all integration tests.
1 parent ed61839 commit 85868c5

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

.circleci/config.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,7 @@ jobs:
184184
- run:
185185
name: Integration tests
186186
command: |
187-
docker login --username ${DOCKERHUB_USER} --password ${DOCKERHUB_PASSWORD} &&
188-
export IMAGE_TAG=$([[ "$CIRCLE_BRANCH" == "staging" ]] && echo "staging-candidate" || echo "discardable") &&
189-
export KUBERNETES_MONITOR_IMAGE_NAME_AND_TAG=snyk/kubernetes-monitor:${IMAGE_TAG}-${CIRCLE_SHA1} &&
190-
docker pull ${KUBERNETES_MONITOR_IMAGE_NAME_AND_TAG} &&
187+
export KUBERNETES_MONITOR_IMAGE_NAME_AND_TAG=$(./scripts/circleci-jobs/setup-integration-tests.py)
191188
npm run test:integration
192189
- run:
193190
name: Notify Slack on failure
@@ -212,10 +209,7 @@ jobs:
212209
- run:
213210
name: Integration tests EKS
214211
command: |
215-
docker login --username ${DOCKERHUB_USER} --password ${DOCKERHUB_PASSWORD} &&
216-
export IMAGE_TAG=$([[ "$CIRCLE_BRANCH" == "staging" ]] && echo "staging-candidate" || echo "discardable") &&
217-
export KUBERNETES_MONITOR_IMAGE_NAME_AND_TAG=snyk/kubernetes-monitor:${IMAGE_TAG}-${CIRCLE_SHA1} &&
218-
docker pull ${KUBERNETES_MONITOR_IMAGE_NAME_AND_TAG} &&
212+
export KUBERNETES_MONITOR_IMAGE_NAME_AND_TAG=$(./scripts/circleci-jobs/setup-integration-tests.py)
219213
.circleci/do-exclusively --branch staging --job ${CIRCLE_JOB} npm run test:integration:eks
220214
- run:
221215
name: Notify Slack on failure
@@ -240,7 +234,7 @@ jobs:
240234
- run:
241235
name: Integration tests OpenShift 3
242236
command: |
243-
export KUBERNETES_MONITOR_IMAGE_NAME_AND_TAG=$(./scripts/circleci-jobs/setup-openshift3-integration-tests.py)
237+
export KUBERNETES_MONITOR_IMAGE_NAME_AND_TAG=$(./scripts/circleci-jobs/setup-integration-tests.py)
244238
npm run test:integration:openshift3
245239
- run:
246240
name: Notify Slack on failure
@@ -264,10 +258,7 @@ jobs:
264258
- run:
265259
name: Integration tests OpenShift 4
266260
command: |
267-
docker login --username ${DOCKERHUB_USER} --password ${DOCKERHUB_PASSWORD} &&
268-
export IMAGE_TAG=$([[ "$CIRCLE_BRANCH" == "staging" ]] && echo "staging-candidate" || echo "discardable") &&
269-
export KUBERNETES_MONITOR_IMAGE_NAME_AND_TAG=snyk/kubernetes-monitor:${IMAGE_TAG}-${CIRCLE_SHA1} &&
270-
docker pull ${KUBERNETES_MONITOR_IMAGE_NAME_AND_TAG} &&
261+
export KUBERNETES_MONITOR_IMAGE_NAME_AND_TAG=$(./scripts/circleci-jobs/setup-integration-tests.py)
271262
.circleci/do-exclusively --branch staging --job ${CIRCLE_JOB} npm run test:integration:openshift4
272263
- run:
273264
name: Delete Operator from Quay

0 commit comments

Comments
 (0)