@@ -100,60 +100,71 @@ jobs:
100100 matrix :
101101 include :
102102 - os : ubuntu-20.04
103- image : nginx-ingress
103+ image : debian
104104 tag : ${{ github.sha }}
105105 marker : ' ingresses'
106106 type : oss
107+ ic-type : nginx-ingress
107108 - os : ubuntu-20.04
108- image : nginx-ingress
109+ image : alpine
109110 tag : ${{ github.sha }}
110111 marker : ' vsr'
111112 type : oss
113+ ic-type : nginx-ingress
112114 - os : ubuntu-20.04
113- image : nginx-ingress
115+ image : opentracing
114116 tag : ${{ github.sha }}
115117 marker : ' vs'
116118 type : oss
119+ ic-type : nginx-ingress
117120 - os : ubuntu-20.04
118- image : nginx-ingress
121+ image : openshift
119122 tag : ${{ github.sha }}
120123 marker : ' ts'
121124 type : oss
125+ ic-type : nginx-ingress
122126 - os : ubuntu-20.04
123- image : nginx-ingress
127+ image : debian
124128 tag : ${{ github.sha }}
125129 marker : ' policies'
126130 type : oss
131+ ic-type : nginx-ingress
127132 - os : ubuntu-20.04
128- image : nginx -plus-ingress
133+ image : openshift -plus
129134 tag : ${{ github.sha }}
130135 marker : ' ingresses'
131136 type : plus
137+ ic-type : nginx-plus-ingress
132138 - os : ubuntu-20.04
133- image : nginx -plus-ingress
139+ image : debian -plus
134140 tag : ${{ github.sha }}
135141 marker : ' vsr'
136142 type : plus
143+ ic-type : nginx-plus-ingress
137144 - os : ubuntu-20.04
138- image : nginx -plus-ingress
145+ image : debian -plus
139146 tag : ${{ github.sha }}
140147 marker : ' vs'
141148 type : plus
149+ ic-type : nginx-plus-ingress
142150 - os : ubuntu-20.04
143- image : nginx -plus-ingress
151+ image : opentracing -plus
144152 tag : ${{ github.sha }}
145153 marker : ' ts'
146154 type : plus
155+ ic-type : nginx-plus-ingress
147156 - os : ubuntu-20.04
148- image : nginx -plus-ingress
157+ image : debian -plus
149158 tag : ${{ github.sha }}
150159 marker : ' policies'
151160 type : plus
161+ ic-type : nginx-plus-ingress
152162 - os : ubuntu-20.04
153- image : nginx -plus-ingress
163+ image : debian -plus-ap
154164 tag : ${{ github.sha }}-ap
155165 marker : ' appprotect'
156166 type : plus-ap
167+ ic-type : nginx-plus-ingress
157168 steps :
158169 - name : Checkout Repository
159170 uses : actions/checkout@v2
@@ -184,7 +195,7 @@ jobs:
184195 tags : ${{ matrix.image }}:${{ matrix.tag }}
185196 load : true
186197 build-args : |
187- BUILD_OS=debian
198+ BUILD_OS=${{ matrix.image }}
188199 if : matrix.type == 'oss'
189200 - name : Build Plus Docker Image ${{ matrix.image }}
190201 uses : docker/build-push-action@v2
@@ -200,24 +211,23 @@ jobs:
200211 "nginx-repo.crt=${{ secrets.KIC_NGINX_CRT }}"
201212 "nginx-repo.key=${{ secrets.KIC_NGINX_KEY }}"
202213 build-args : |
203- BUILD_OS=debian-plus
214+ BUILD_OS=${{ matrix.image }}
204215 PLUS=-plus
205216 if : matrix.type == 'plus'
206217 - name : Build AP Docker Image ${{ matrix.image }}
207218 uses : docker/build-push-action@v2
208219 with :
209220 file : build/Dockerfile
210221 context : ' .'
211- cache-from : type=local,src=/tmp/.buildx-cache
212- cache-to : type=local,dest=/tmp/.buildx-cache
213222 target : local
214223 tags : ${{ matrix.image }}:${{ matrix.tag }}
215224 load : true
216225 secrets : |
217226 "nginx-repo.crt=${{ secrets.KIC_NGINX_AP_CRT }}"
218227 "nginx-repo.key=${{ secrets.KIC_NGINX_AP_KEY }}"
228+ "rhel_license=${{ secrets.KIC_RHEL_LICENSE }}"
219229 build-args : |
220- BUILD_OS=debian-plus-ap
230+ BUILD_OS=${{ matrix.image }}
221231 PLUS=-plus
222232 if : matrix.type == 'plus-ap'
223233 - name : Build Test-Runner Container
@@ -244,7 +254,7 @@ jobs:
244254 kind create cluster --name ${{ github.run_id }} --image=kindest/node:v${{ env.K8S_VERSION }} --config kind-config.yaml --kubeconfig kube-${{ github.run_id }} --wait ${{ env.K8S_TIMEOUT }}
245255 kind load docker-image ${{ matrix.image }}:${{ matrix.tag }} --name ${{ github.run_id }}
246256 echo ::set-output name=cluster_ip::$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${{ github.run_id }}-control-plane)
247- echo ::set-output name=cluster::$(echo 'nginx-${{ matrix.type }}-${{ matrix.marker }}')
257+ echo ::set-output name=cluster::$(echo 'nginx-${{ matrix.image }}-${{ matrix.marker }}')
248258 - name : Setup Kubeconfig
249259 run : |
250260 sed -i 's|server:.*|server: https://${{ steps.k8s.outputs.cluster_ip }}:6443|' kube-${{ github.run_id }}
@@ -259,7 +269,7 @@ jobs:
259269 --context=kind-${{ github.run_id }} \
260270 --image=${{ matrix.image }}:${{ matrix.tag }} \
261271 --image-pull-policy=Never \
262- --ic-type=${{ matrix.image }} \
272+ --ic-type=${{ matrix.ic-type }} \
263273 --service=nodeport --node-ip=${{ steps.k8s.outputs.cluster_ip }} \
264274 --html=tests-${{ steps.k8s.outputs.cluster }}.html \
265275 --self-contained-html \
@@ -273,6 +283,48 @@ jobs:
273283 path : ${{ github.workspace }}/tests/tests-${{ steps.k8s.outputs.cluster }}.html
274284 if : always()
275285
286+ build :
287+ name : Build Docker Images
288+ runs-on : ubuntu-20.04
289+ needs : [binary, unit-tests]
290+ if :
291+ github.event.pull_request.head.repo.full_name == 'nginxinc/kubernetes-ingress' ||
292+ github.event_name == 'push'
293+ steps :
294+ - name : Checkout Repository
295+ uses : actions/checkout@v2
296+ - name : Fetch Cached Artifacts
297+ 298+ with :
299+ path : ${{ github.workspace }}/nginx-ingress
300+ key : nginx-ingress-${{ github.run_id }}-${{ github.run_number }}
301+ - name : Docker Buildx
302+ uses : docker/setup-buildx-action@v1
303+ with :
304+ driver-opts : network=host
305+ - name : Cache Docker layers
306+ 307+ with :
308+ path : /tmp/.buildx-cache
309+ key : ${{ runner.os }}-buildx-${{ github.sha }}
310+ restore-keys : |
311+ ${{ runner.os }}-buildx-
312+ - name : Build AP Docker Image ${{ matrix.image }}
313+ uses : docker/build-push-action@v2
314+ with :
315+ file : build/DockerfileWithAppProtectForPlusForOpenShift
316+ context : ' .'
317+ cache-from : type=local,src=/tmp/.buildx-cache
318+ cache-to : type=local,dest=/tmp/.buildx-cache
319+ target : local
320+ tags : nginx-plus-ingress-ap-openshift:${{ github.sha }}
321+ secrets : |
322+ "nginx-repo.crt=${{ secrets.KIC_NGINX_AP_CRT }}"
323+ "nginx-repo.key=${{ secrets.KIC_NGINX_AP_KEY }}"
324+ "rhel_license=${{ secrets.KIC_RHEL_LICENSE }}"
325+ build-args : |
326+ PLUS=-plus
327+
276328 helm-tests :
277329 name : Helm Tests
278330 runs-on : ${{ matrix.os }}
0 commit comments