2
2
VERSION = edge
3
3
GIT_COMMIT = $(shell git rev-parse HEAD || echo "unknown")
4
4
DATE = $(shell date -u +"% Y-% m-% dT% H:% M:% SZ")
5
- MANIFEST_DIR = $(shell pwd ) /deploy/manifests
6
- CHART_DIR = $(shell pwd ) /deploy/helm-chart
5
+ MANIFEST_DIR = $(CURDIR ) /deploy/manifests
6
+ CHART_DIR = $(CURDIR ) /deploy/helm-chart
7
7
NGINX_CONF_DIR = internal/mode/static/nginx/conf
8
8
NJS_DIR = internal/mode/static/nginx/modules/src
9
9
NGINX_DOCKER_BUILD_PLUS_ARGS = --secret id=nginx-repo.crt,src=nginx-repo.crt --secret id=nginx-repo.key,src=nginx-repo.key
10
10
BUILD_AGENT =local
11
11
TELEMETRY_REPORT_PERIOD = 24h # also configured in goreleaser.yml
12
12
GW_API_VERSION = 1.0.0
13
13
INSTALL_WEBHOOK = false
14
+ NODE_VERSION = $(shell cat .nvmrc)
14
15
15
16
# go build flags - should not be overridden by the user
16
17
GO_LINKER_FlAGS_VARS = -X main.version=${VERSION} -X main.commit=${GIT_COMMIT} -X main.date=${DATE} -X main.telemetryReportPeriod=${TELEMETRY_REPORT_PERIOD}
@@ -24,7 +25,7 @@ NGINX_PLUS_PREFIX ?= $(PREFIX)/nginx-plus## The name of the nginx plus image. Fo
24
25
TAG ?= $(VERSION:v%=% ) # # The tag of the image. For example, 0.3.0
25
26
TARGET ?= local# # The target of the build. Possible values: local and container
26
27
KIND_KUBE_CONFIG=$${HOME}/.kube/kind/config# # The location of the kind kubeconfig
27
- OUT_DIR ?= $(shell pwd ) /build/out# # The folder where the binary will be stored
28
+ OUT_DIR ?= $(CURDIR ) /build/out# # The folder where the binary will be stored
28
29
GOARCH ?= amd64# # The architecture of the image and/or binary. For example: amd64 or arm64
29
30
GOOS ?= linux# # The OS of the image and/or binary. For example: linux or darwin
30
31
override HELM_TEMPLATE_COMMON_ARGS += --set creator=template --set nameOverride=nginx-gateway# # The common options for the Helm template command.
@@ -125,17 +126,17 @@ fmt: ## Run go fmt against code
125
126
.PHONY : njs-fmt
126
127
njs-fmt : # # Run prettier against the njs httpmatches module
127
128
docker run --rm -w /modules \
128
- -v $(PWD ) /internal/nginx/modules/:/modules/ \
129
- node:18 \
130
- /bin/bash -c " npm install && npm run format"
129
+ -v $(CURDIR ) /internal/nginx/modules/:/modules/ \
130
+ node:${NODE_VERSION} \
131
+ /bin/bash -c " npm ci && npm run format"
131
132
132
133
.PHONY : vet
133
134
vet : # # Run go vet against code
134
135
go vet ./...
135
136
136
137
.PHONY : lint
137
138
lint : # # Run golangci-lint against code
138
- docker run --pull always --rm -v $(shell pwd ) :/nginx-gateway-fabric -w /nginx-gateway-fabric -v $(shell go env GOCACHE) :/cache/go -e GOCACHE=/cache/go -e GOLANGCI_LINT_CACHE=/cache/go -v $(shell go env GOPATH) /pkg:/go/pkg golangci/golangci-lint:latest golangci-lint --color always run
139
+ docker run --pull always --rm -v $(CURDIR ) :/nginx-gateway-fabric -w /nginx-gateway-fabric -v $(shell go env GOCACHE) :/cache/go -e GOCACHE=/cache/go -e GOLANGCI_LINT_CACHE=/cache/go -v $(shell go env GOPATH) /pkg:/go/pkg golangci/golangci-lint:latest golangci-lint --color always run
139
140
140
141
.PHONY : unit-test
141
142
unit-test : # # Run unit tests for the go code
@@ -148,9 +149,9 @@ unit-test: ## Run unit tests for the go code
148
149
.PHONY : njs-unit-test
149
150
njs-unit-test : # # Run unit tests for the njs httpmatches module
150
151
docker run --rm -w /modules \
151
- -v $(PWD ) /internal/mode/static/nginx/modules:/modules/ \
152
- node:18 \
153
- /bin/bash -c " npm install && npm test && npm run clean"
152
+ -v $(CURDIR ) /internal/mode/static/nginx/modules:/modules/ \
153
+ node:${NODE_VERSION} \
154
+ /bin/bash -c " npm ci && npm test && npm run clean"
154
155
155
156
.PHONY : lint-helm
156
157
lint-helm : # # Run the helm chart linter
0 commit comments