Skip to content

Commit 052e600

Browse files
author
Rodrigo Valin
committed
Builds and push e2e image.
1 parent 653da0a commit 052e600

File tree

5 files changed

+21
-12
lines changed

5 files changed

+21
-12
lines changed

.evergreen.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,24 @@ functions:
8383
add_to_path:
8484
- ${workdir}/bin
8585
working_dir: mongodb-kubernetes-operator
86-
binary: scripts/ci/run_test.sh
8786
include_expansions_in_env:
8887
- revision
88+
binary: scripts/ci/run_test.sh
8989
env:
9090
KUBECONFIG: ${workdir}/kube_config
9191

92-
build_and_push_operator:
92+
build_and_push_image:
9393
- command: subprocess.exec
9494
type: setup
9595
params:
9696
include_expansions_in_env:
9797
- revision
9898
- quay_user_name
9999
- quay_password
100+
- image
101+
- dockerfile
100102
working_dir: mongodb-kubernetes-operator
101-
binary: scripts/ci/build_and_push_operator.sh
103+
binary: scripts/ci/build_and_push_image.sh
102104

103105
tasks:
104106
- name: unit_tests
@@ -109,9 +111,16 @@ tasks:
109111
- name: e2e_test
110112
commands:
111113
- func: clone
112-
- func: build_and_push_operator
114+
- func: build_and_push_image
115+
vars:
116+
dockerfile: docker/Dockerfile.operator
117+
image: quay.io/mongodb/community-operator-dev:${revision}
113118
- func: setup_kubernetes_environment
114119
- func: deploy_operator
120+
- func: build_and_push_image
121+
vars:
122+
dockerfile: docker/Dockerfile.e2e
123+
image: quay.io/mongodb/community-operator-e2e:${revision}
115124
- func: run_e2e_test
116125

117126
buildvariants:

scripts/ci/build_and_push_image.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
echo ${quay_password} | docker login -u=${quay_user_name} quay.io --password-stdin
4+
5+
docker build . -f ${dockerfile} -t ${image}
6+
docker push ${image}

scripts/ci/build_and_push_operator.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

scripts/ci/run_test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ contents="$(cat ${temp})"
1212
kubectl create cm kube-config --from-literal=kubeconfig="${contents}"
1313
rm ${temp}
1414

15+
sed -i "s|E2E_TEST_IMAGE|quay.io/mongodb/community-operator-e2e:${revision}|g" test/replica_set_test.yaml
1516
kubectl apply -f test/replica_set_test.yaml
1617

1718
echo "Waiting for test application to be deployed"

test/replica_set_test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
app: operator-sdk-test
77
spec:
88
containers:
9-
- image: quay.io/chatton/operator-sdk-test #TODO: provide image built during that test run
9+
- image: E2E_TEST_IMAGE
1010
imagePullPolicy: Always
1111
name: operator-sdk-test
1212
volumeMounts:

0 commit comments

Comments
 (0)