81
81
82
82
include ./includes/$(osinclude )
83
83
84
+ # personal includes, excluded from the git repository
85
+ -include ./local-includes/*.mk
86
+
84
87
# _____ _
85
88
# |_ _|_ _ _ __ __ _ ___| |_ ___
86
89
# | |/ _` | '__/ _` |/ _ \ __/ __|
@@ -99,7 +102,7 @@ build-sdks: build-sdk-cpp
99
102
100
103
# Run all tests
101
104
test : ensure-build-image
102
- docker run --rm $(common_mounts ) --entrypoint=go $(build_tag ) test -race $(agones_package ) /...
105
+ docker run --rm $(common_mounts ) $(build_tag ) go test -race $(agones_package ) /...
103
106
104
107
# Push all the images up to $(REGISTRY)
105
108
push : push-controller-image push-agones-sdk-image
@@ -112,7 +115,7 @@ install: ensure-build-image
112
115
sed -i -e ' s!$${REGISTRY}!$(REGISTRY)!g' -e ' s!$${VERSION}!$(VERSION)!g' \
113
116
-e ' s!$${IMAGE_PULL_POLICY}!$(IMAGE_PULL_POLICY)!g' -e ' s!$${ALWAYS_PULL_SIDECAR}!$(ALWAYS_PULL_SIDECAR)!g' \
114
117
$(build_path ) /.install.yaml
115
- docker run --rm $(common_mounts ) $(ARGS ) $(build_tag ) kubectl apply -f $(mount_path ) /build/.install.yaml
118
+ docker run --rm $(common_mounts ) $(DOCKER_RUN_ARGS ) $(build_tag ) kubectl apply -f $(mount_path ) /build/.install.yaml
116
119
117
120
# Build a static binary for the gameserver controller
118
121
build-controller-binary : ensure-build-image
@@ -121,7 +124,7 @@ build-controller-binary: ensure-build-image
121
124
122
125
# Build the image for the gameserver controller
123
126
build-controller-image : ensure-build-image build-controller-binary
124
- docker build $(agones_path ) /cmd/controller/ --tag=$(controller_tag )
127
+ docker build $(agones_path ) /cmd/controller/ --tag=$(controller_tag ) $( DOCKER_BUILD_ARGS )
125
128
126
129
# push the gameservers controller image
127
130
push-controller-image : ensure-build-image
@@ -138,48 +141,48 @@ build-agones-sdk-binary: ensure-build-image
138
141
139
142
# Build the image for the gameserver sidecar
140
143
build-agones-sdk-image : ensure-build-image build-agones-sdk-binary
141
- docker build $(agones_path ) /cmd/sdk-server/ --tag=$(sidecar_tag )
144
+ docker build $(agones_path ) /cmd/sdk-server/ --tag=$(sidecar_tag ) $( DOCKER_BUILD_ARGS )
142
145
143
146
# Build the cpp sdk linux archive
144
147
build-sdk-cpp : ensure-build-image
145
- docker run --rm $(common_mounts ) -w $(mount_path ) /sdks/cpp --entrypoint make $(build_tag ) build install archive VERSION=$(VERSION )
148
+ docker run --rm $(common_mounts ) -w $(mount_path ) /sdks/cpp $(build_tag ) make build install archive VERSION=$(VERSION )
146
149
147
150
# push the gameservers sidecar image
148
151
push-agones-sdk-image : ensure-build-image
149
152
docker push $(sidecar_tag )
150
153
151
154
# Generate the SDK gRPC server and client code
152
155
gen-gameservers-sdk-grpc : ensure-build-image
153
- docker run --rm $(common_mounts ) --entrypoint= " /root/gen-grpc-go.sh" $( build_tag )
154
- docker run --rm $(common_mounts ) --entrypoint= " /root/gen-grpc-cpp.sh" $( build_tag )
156
+ docker run --rm $(common_mounts ) -w $( mount_path ) $( build_tag ) /root/gen-grpc-go.sh
157
+ docker run --rm $(common_mounts ) -w $( mount_path ) $( build_tag ) /root/gen-grpc-cpp.sh
155
158
156
159
# Generate the client for our CustomResourceDefinition
157
160
gen-crd-client : ensure-build-image
158
- docker run --rm $(common_mounts ) --entrypoint= " /root/gen-crd-client.sh" $( build_tag )
159
- docker run --rm $(common_mounts ) --entrypoint=goimports $( build_tag ) - w $(mount_path ) /pkg
161
+ docker run --rm $(common_mounts ) -w $( mount_path ) $( build_tag ) /root/gen-crd-client.sh
162
+ docker run --rm $(common_mounts ) -w $(mount_path ) /pkg $( build_tag ) goimports
160
163
161
164
# Run a bash shell with the developer tools in it. (Creates the image if it doesn't exist)
162
- # Can use ARGS for extra arguments.
165
+ # Can use DOCKER_RUN_ARGS for extra arguments.
163
166
shell : ensure-build-image
164
167
docker run -it --rm \
165
168
$(common_mounts ) \
166
169
-w $(mount_path ) \
167
- $(ARGS ) \
168
- --entrypoint=bash $(build_tag ) -l
170
+ $(DOCKER_RUN_ARGS ) \
171
+ $(build_tag ) bash -l
169
172
170
173
# run a container with godoc
171
174
godoc :
172
175
if [ ! -f $( build_path) /.index ]; then \
173
176
touch $(build_path ) /.index && \
174
177
docker run -p 8888:8888 --rm $(common_mounts ) -v $(build_path ) /.index:/root/.index \
175
- --entrypoint=godoc $(build_tag ) -http=" :8888" -index=true -write_index=true -index_files=/root/.index; \
178
+ $(build_tag ) godoc -http=" :8888" -index=true -write_index=true -index_files=/root/.index; \
176
179
fi
177
180
docker run -p 8888:8888 --rm $(common_mounts ) -v $(build_path ) /.index:/root/.index \
178
- --entrypoint=godoc $(build_tag ) -http=" :8888" -index=true -index_files=/root/.index
181
+ $(build_tag ) godoc -http=" :8888" -index=true -index_files=/root/.index
179
182
180
183
# Creates the build docker image
181
184
build-build-image :
182
- docker build --tag=$(build_tag ) $(build_path ) /build-image
185
+ docker build --tag=$(build_tag ) $(build_path ) /build-image $( DOCKER_BUILD_ARGS )
183
186
184
187
# Deletes the local build docker image
185
188
clean-build-image :
@@ -215,24 +218,21 @@ push-build-image:
215
218
216
219
# Initialise the gcloud login and project configuration, if you are working with GCP
217
220
gcloud-init : ensure-build-config
218
- docker run --rm -it \
219
- $(common_mounts ) \
220
- --entrypoint=" gcloud" $(build_tag ) init
221
+ docker run --rm -it $(common_mounts ) $(build_tag ) gcloud init
221
222
222
223
# Creates and authenticates a small, 3 node GKE cluster to work against
223
224
gcloud-test-cluster : ensure-build-image
224
- docker run --rm -it $(common_mounts ) \
225
- --entrypoint=" gcloud" $(build_tag ) \
225
+ docker run --rm -it $(common_mounts ) $(build_tag ) gcloud \
226
226
deployment-manager deployments create test-cluster --config=$(mount_path ) /build/gke-test-cluster/deployment.yml
227
227
$(MAKE ) gcloud-auth-cluster
228
228
229
229
# Pulls down authentication information for kubectl against a cluster, name can be specified through CLUSTER_NAME
230
230
# (defaults to 'test-cluster')
231
231
gcloud-auth-cluster : ensure-build-image
232
- docker run --rm $(common_mounts ) --entrypoint= " gcloud " $(build_tag ) config set container/cluster $(CLUSTER_NAME )
233
- docker run --rm $(common_mounts ) --entrypoint= " gcloud " $(build_tag ) config set compute/zone \
232
+ docker run --rm $(common_mounts ) $(build_tag ) gcloud config set container/cluster $(CLUSTER_NAME )
233
+ docker run --rm $(common_mounts ) $(build_tag ) gcloud config set compute/zone \
234
234
` grep zone: $( build_path) /gke-test-cluster/deployment.yml | sed ' s/zone: //' `
235
- docker run --rm $(common_mounts ) --entrypoint= " gcloud " $(build_tag ) container clusters get-credentials $(CLUSTER_NAME )
235
+ docker run --rm $(common_mounts ) $(build_tag ) gcloud container clusters get-credentials $(CLUSTER_NAME )
236
236
237
237
# authenticate our docker configuration so that you can do a docker push directly
238
238
# to the gcr.io repository
@@ -271,7 +271,7 @@ minikube-agones-profile:
271
271
# Connecting to minikube requires so enhanced permissions, so use this target
272
272
# instead of `make shell` to start an interactive shell for development on minikube.
273
273
minikube-shell : ensure-build-image minikube-agones-profile
274
- $(MAKE ) shell ARGS =" --network=host -v $( minikube_cert_mount) $( ARGS ) "
274
+ $(MAKE ) shell DOCKER_RUN_ARGS =" --network=host -v $( minikube_cert_mount) $( DOCKER_RUN_ARGS ) "
275
275
276
276
# Push the local Agones Docker images that have already been built
277
277
# via `make build` or `make build-images` into the "agones" minikube instance.
@@ -282,7 +282,7 @@ minikube-push: minikube-agones-profile
282
282
# Installs the current development version of Agones into the Kubernetes cluster.
283
283
# Use this instead of `make install`, as it disables PullAlways on the install.yaml
284
284
minikube-install : minikube-agones-profile
285
- $(MAKE ) install ARGS =" --network=host -v $( minikube_cert_mount) " ALWAYS_PULL_SIDECAR=false IMAGE_PULL_POLICY=IfNotPresent
285
+ $(MAKE ) install DOCKER_RUN_ARGS =" --network=host -v $( minikube_cert_mount) " ALWAYS_PULL_SIDECAR=false IMAGE_PULL_POLICY=IfNotPresent
286
286
287
287
# Convenience target for transferring images into minikube.
288
288
# Use TAG to specify the image to transfer into minikube
0 commit comments