Skip to content

Commit 78afe55

Browse files
committed
update makefile
1 parent e79cb4a commit 78afe55

File tree

2 files changed

+15
-22
lines changed

2 files changed

+15
-22
lines changed

.github/workflows/functional.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
strategy:
4040
matrix:
4141
k8s-version: ["latest"]
42-
nginx-image: [nginx-plus]
42+
nginx-image: [nginx, nginx-plus]
4343
steps:
4444
- name: Checkout Repository
4545
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -118,24 +118,18 @@ jobs:
118118
cache-from: type=gha
119119
cache-to: type=gha,mode=max
120120
pull: true
121+
target: goreleaser
121122

122123
- name: Build NGINX Docker Image
123-
id: docker-nginx
124124
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
125125
with:
126-
file: build/Dockerfile${{ inputs.image == 'nginx' && '.nginx' || '' }}${{ inputs.image == 'plus' && '.nginxplus' || '' }}
127-
context: "."
128-
target: ${{ inputs.image == 'ngf' && 'goreleaser' || '' }}
126+
file: build/Dockerfile${{ matrix.nginx-image == 'nginx' && '.nginx' || '' }}${{ matrix.nginx-image == 'nginx-plus' && '.nginxplus' || ''}}
129127
tags: ${{ steps.nginx-meta.outputs.tags }}
130-
labels: ${{ steps.nginx-meta.outputs.labels }}
131-
annotations: ${{ steps.nginx-meta.outputs.annotations }}
132-
push: false
133-
platforms: ${{ inputs.platforms }}
134-
cache-from: type=gha
135-
cache-to: type=gha,mode=max
128+
context: "."
136129
load: true
137-
pull: false
138-
no-cache: ${{ github.event_name != 'pull_request' }}
130+
cache-from: type=gha,scope=${{ matrix.nginx-image }}
131+
cache-to: type=gha,scope=${{ matrix.nginx-image }},mode=max
132+
pull: true
139133
build-args: |
140134
NJS_DIR=internal/mode/static/nginx/modules/src
141135
NGINX_CONF_DIR=internal/mode/static/nginx/conf
@@ -151,6 +145,13 @@ jobs:
151145
make create-kind-cluster KIND_KUBE_CONFIG=${kube_config}
152146
echo "KUBECONFIG=${kube_config}" >> "$GITHUB_ENV"
153147
148+
- name: Wait for release to exist
149+
if: startsWith(github.ref, 'refs/tags/')
150+
run: |
151+
REF=${{ github.ref_name }}
152+
until docker pull ghcr.io/nginxinc/nginx-gateway-fabric:${REF#v}; do sleep 5; done
153+
until docker pull ghcr.io/nginxinc/nginx-gateway-fabric/nginx:${REF#v}; do sleep 5; done
154+
154155
- name: Setup functional tests
155156
id: setup
156157
run: |
@@ -160,7 +161,7 @@ jobs:
160161
make load-images${{ matrix.nginx-image == 'nginx-plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag}
161162
working-directory: ./tests
162163

163-
- name: Run NGINX functional tests
164+
- name: Run functional tests
164165
run: |
165166
ngf_prefix=ghcr.io/nginxinc/nginx-gateway-fabric
166167
ngf_tag=${{ steps.ngf-meta.outputs.version }}

tests/Makefile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@ help: Makefile ## Display this help
3232
create-kind-cluster: ## Create a kind cluster
3333
cd .. && make create-kind-cluster
3434

35-
.PHONY: build-images
36-
build-images: ## Build NGF and NGINX images
37-
cd .. && make PREFIX=$(PREFIX) TAG=$(TAG) build-images
38-
39-
.PHONY: build-images-with-plus
40-
build-images-with-plus: ## Build NGF and NGINX Plus images
41-
cd .. && make PREFIX=$(PREFIX) TAG=$(TAG) build-images-with-plus
42-
4335
.PHONY: load-images
4436
load-images: ## Load NGF and NGINX images on configured kind cluster
4537
cd .. && make PREFIX=$(PREFIX) TAG=$(TAG) load-images

0 commit comments

Comments
 (0)