77 branches : ["main", "release*"]
88
99env :
10- GO_VERSION : " 1.17 "
10+ GO_VERSION : " 1.18 "
1111 GO111MODULE : " on"
1212 OPERATOR_IMAGE : " quay.io/redhat-et-ipfs/ipfs-operator"
1313 BUNDLE_IMAGE : " quay.io/redhat-et-ipfs/ipfs-operator-bundle"
14- TAG : v0.0.1
15- CLUSTER_IMAGE : " quay.io/redhat-et-ipfs/cluster"
16- CLUSTER_VERSION : v1.0.0
14+ TAG : " v0.0.1"
1715
1816
1917jobs :
@@ -34,15 +32,15 @@ jobs:
3432 run : make test
3533
3634 - name : Build operator container
37- run : make docker-build IMG=${OPERATOR_IMAGE}:${TAG}
35+ run : make docker-build IMG=" ${OPERATOR_IMAGE}"
3836
3937 - name : Export container image
40- run : docker save -o /tmp/operator.tar ${OPERATOR_IMAGE}:${TAG}
38+ run : docker save -o /tmp/operator.tar ${OPERATOR_IMAGE}
4139
4240 - name : Save container as artifact
4341 uses : actions/upload-artifact@v1
4442 with :
45- name : ipfs-operator
43+ name : ipfs-cluster- operator
4644 path : /tmp/operator.tar
4745
4846 build-bundle :
7876 name : operator-bundle
7977 path : /tmp/bundle.tar
8078
81- cluster :
82- name : build cluster image
83- runs-on : ubuntu-20.04
84- steps :
85- - uses : actions/checkout@v2
86- with :
87- repository : ipfs/ipfs-cluster
88- ref : ${{ env.CLUSTER_VERSION }}
89-
90- - name : podman build
91- run : |
92- podman build -t ${{ env.CLUSTER_IMAGE }}:${{ env.CLUSTER_VERSION }} .
93-
94- - name : save the image
95- run : podman save -o /tmp/cluster.tar ${{ env.CLUSTER_IMAGE }}:${{ env.CLUSTER_VERSION }}
96-
97- - name : archive the image
98- uses : actions/upload-artifact@v1
99- with :
100- name : cluster
101- path : /tmp/cluster.tar
102-
103- deploy :
104- name : Deploy Kind cluster and run tests
105- needs : [ build-bundle, build-operator, cluster ]
79+ e2e :
80+ name : End-to-end tests
81+ needs : [ build-bundle, build-operator ]
10682 runs-on : ubuntu-20.04
10783 steps :
10884 - uses : actions/checkout@v2
11288 curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
11389 sudo install ./kubectl /usr/local/bin/
11490 kubectl version --short --client
115-
91+
92+
11693 - name : Install the Kind binary
11794 run : |
11895 curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.12.0/kind-linux-amd64
@@ -121,63 +98,37 @@ jobs:
12198 kind version
12299
123100 - name : Create a Kind Cluster
124- run : kind create cluster
125-
126- - name : Pull the Container Image from Artifacts
127- uses : actions/download-artifact@v1
128- with :
129- name : operator-bundle
130- path : /tmp
131-
132- - name : Load the Container Image
133- run : docker load -i /tmp/bundle.tar
134-
135- - name : Load the Container Image into Kind
136- run : kind load docker-image ${BUNDLE_IMAGE}:${TAG}
101+ run : ./hack/setup-kind-cluster.sh
137102
138103 - name : Pull the Container Image from Artifacts
139104 uses : actions/download-artifact@v1
140105 with :
141- name : ipfs-operator
106+ name : ipfs-cluster- operator
142107 path : /tmp
143108
144109 - name : Load the Container Image
145- run : docker load -i /tmp/operator.tar
146-
147- - name : Load the Container Image into Kind
148- run : kind load docker-image ${OPERATOR_IMAGE}:${TAG}
149-
150- - name : Pull the Container Image from Artifacts
151- uses : actions/download-artifact@v1
152- with :
153- name : cluster
154- path : /tmp
155-
156- - name : Load the Container Image
157- run : docker load -i /tmp/cluster.tar
158-
159- - name : Load the Container Image into Kind
160- run : kind load docker-image ${CLUSTER_IMAGE}:${CLUSTER_VERSION}
161-
162- - name : Install operator-sdk
163110 run : |
164- curl -L -o operator-sdk https://github.com/operator-framework/operator-sdk/releases/download/v1.11.0/operator-sdk_linux_amd64
165- sudo install ./operator-sdk /usr/local/bin && rm operator-sdk
111+ docker load -i /tmp/operator.tar
112+ docker inspect ${OPERATOR_IMAGE}
113+ docker tag ${OPERATOR_IMAGE} ${OPERATOR_IMAGE}:ci-build
114+ kind load docker-image ${OPERATOR_IMAGE}:ci-build
166115
167- - name : Install the operator
116+ - name : Load the Operator into Kind
168117 run : |
169- make bundle
170- kubectl create ns ipfs-operator-system
171- make deploy
172- kubectl get events -n ipfs-operator-system
173- kubectl get po -A
118+ helm upgrade --install \
119+ --debug \
120+ --set image.tag="ci-build" \
121+ --wait --timeout=300s \
122+ ipfs-cluster ./helm/ipfs-operator
174123
175124 - name : run e2e tests
176- run : make test-e2e
125+ run : |
126+ mkdir bin
127+ make test-e2e
177128
178129 push-operator :
179130 name : Push operator container to registry
180- needs : deploy
131+ needs : e2e
181132 if : >
182133 (github.event_name == 'push' || github.event_name == 'schedule') &&
183134 (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
@@ -186,13 +137,13 @@ jobs:
186137 - name : Pull the Container Image from Artifacts
187138 uses : actions/download-artifact@v1
188139 with :
189- name : ipfs-operator
140+ name : ipfs-cluster- operator
190141 path : /tmp
191142
192143 - name : Load the Container Image
193144 run : |
194145 docker load -i /tmp/operator.tar
195- docker inspect ${OPERATOR_IMAGE}:${TAG}
146+ docker inspect ${OPERATOR_IMAGE}
196147
197148 - name : Login to registry
198149 # If the registry server is specified in the image name, we use that.
@@ -206,11 +157,12 @@ jobs:
206157 (github.event_name == 'push' || github.event_name == 'schedule') &&
207158 github.ref == 'refs/heads/main'
208159 run : |
160+ docker tag ${OPERATOR_IMAGE} ${OPERATOR_IMAGE}:${TAG}
209161 docker push "${OPERATOR_IMAGE}:${TAG}"
210162
211163 push-bundle :
212164 name : Push bundle container to registry
213- needs : deploy
165+ needs : e2e
214166 if : >
215167 (github.event_name == 'push' || github.event_name == 'schedule') &&
216168 (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
@@ -227,7 +179,7 @@ jobs:
227179 run : |
228180 docker load -i /tmp/bundle.tar
229181 docker inspect "${BUNDLE_IMAGE}:${{ env.TAG }}"
230-
182+
231183 - name : Login to registry
232184 # If the registry server is specified in the image name, we use that.
233185 # If the server isn't in the image name, default to docker.io
@@ -243,39 +195,3 @@ jobs:
243195 run : |
244196 echo "Pushing to ${{ env.TAG }}"
245197 docker push "${BUNDLE_IMAGE}:${{ env.TAG }}"
246-
247- push-cluster :
248- name : Push cluster image to registry
249- needs : deploy
250- if : >
251- (github.event_name == 'push' || github.event_name == 'schedule') &&
252- (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
253- runs-on : ubuntu-20.04
254-
255- steps :
256- - name : Load container artifact
257- uses : actions/download-artifact@v1
258- with :
259- name : cluster
260- path : /tmp
261-
262- - name : Import container image
263- run : |
264- docker load -i /tmp/cluster.tar
265- docker inspect "${CLUSTER_IMAGE}:${{ env.CLUSTER_VERSION }}"
266-
267- - name : Login to registry
268- # If the registry server is specified in the image name, we use that.
269- # If the server isn't in the image name, default to docker.io
270- run : |
271- [[ "${BUNDLE_IMAGE}" =~ ^([^/]+)/[^/]+/[^/]+ ]] && REGISTRY="${BASH_REMATCH[1]}" || REGISTRY="docker.io"
272- echo "Attempting docker login to: ${REGISTRY}"
273- echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin ${REGISTRY}
274-
275- - name : Push to registry (version tag)
276- if : >
277- (github.event_name == 'push' || github.event_name == 'schedule') &&
278- github.ref == 'refs/heads/main'
279- run : |
280- echo "Pushing to ${CLUSTER_IMAGE}:${{ env.CLUSTER_VERSION }}"
281- docker push "${CLUSTER_IMAGE}:${{ env.CLUSTER_VERSION }}"
0 commit comments