@@ -102,6 +102,7 @@ workdir_path = $(mount_path)
102
102
build_version = $(call sha,$(build_path ) /build-image/Dockerfile)
103
103
build_tag = agones-build:$(build_version )
104
104
controller_tag = $(REGISTRY ) /agones-controller:$(VERSION )
105
+ extensions_tag = $(REGISTRY ) /agones-extensions:$(VERSION )
105
106
sidecar_tag = $(REGISTRY ) /agones-sdk:$(VERSION )
106
107
allocator_tag = $(REGISTRY ) /agones-allocator:$(VERSION )
107
108
ping_tag = $(REGISTRY ) /agones-ping:$(VERSION )
@@ -118,13 +119,16 @@ allocator_amd64_tag = $(allocator_tag)-amd64
118
119
allocator_arm64_tag = $(allocator_tag ) -arm64
119
120
controller_amd64_tag = $(controller_tag ) -amd64
120
121
controller_arm64_tag = $(controller_tag ) -arm64
122
+ extensions_amd64_tag = $(extensions_tag ) -amd64
123
+ extensions_arm64_tag = $(extensions_tag ) -arm64
121
124
ping_amd64_tag = $(ping_tag ) -amd64
122
125
ping_arm64_tag = $(ping_tag ) -arm64
123
126
124
127
# build list of images to include in the manifest for the sidecar image.
125
128
push_sidecar_manifest = $(sidecar_linux_amd64_tag )
126
129
push_allocator_manifest = $(allocator_amd64_tag )
127
130
push_controller_manifest = $(controller_amd64_tag )
131
+ push_extensions_manifest = $(extensions_amd64_tag )
128
132
push_ping_manifest = $(ping_amd64_tag )
129
133
gomod_on = GO111MODULE=on
130
134
@@ -250,14 +254,15 @@ ifeq ($(WITH_ARM64), 1)
250
254
push_sidecar_manifest += $(sidecar_linux_arm64_tag )
251
255
push_allocator_manifest += $(allocator_arm64_tag )
252
256
push_controller_manifest += $(controller_arm64_tag )
257
+ push_extensions_manifest += $(extensions_arm64_tag )
253
258
push_ping_manifest += $(ping_arm64_tag )
254
259
endif
255
260
256
261
# build all
257
262
build : build-images build-sdks
258
263
259
264
# build the docker images
260
- build-images : build-controller-image build-agones-sdk-image build-ping-image build-allocator-image
265
+ build-images : build-controller-image build-extensions-image build- agones-sdk-image build-ping-image build-allocator-image
261
266
262
267
# package the current agones helm chart
263
268
build-chart : RELEASE_VERSION ?= $(base_version )
@@ -342,7 +347,7 @@ test-install-yaml:
342
347
diff /tmp/agones-install/install.yaml.sorted /tmp/agones-install/install.current.yaml.sorted
343
348
344
349
# Push all the images up to $(REGISTRY)
345
- push : push-controller-image push-agones-sdk-image push-ping-image push-allocator-image
350
+ push : push-controller-image push-extensions-image push- agones-sdk-image push-ping-image push-allocator-image
346
351
347
352
# Installs the current development version of Agones into the Kubernetes cluster
348
353
install : ALWAYS_PULL_SIDECAR := true
@@ -401,6 +406,22 @@ build-controller-binary-linux-arm64: $(ensure-build-image)
401
406
-tags $(GO_BUILD_TAGS ) -o $(go_build_base_path ) /cmd/controller/bin/controller.linux.arm64 \
402
407
$(go_rebuild_flags ) $(go_version_flags ) -installsuffix cgo $(agones_package ) /cmd/controller
403
408
409
+ # Build a static binary for the gamerserver extensions
410
+ ifeq ($(WITH_ARM64 ) , 1)
411
+ build-extensions-binary : $(ensure-build-image ) build-extensions-binary-linux-amd64 build-extensions-binary-linux-arm64
412
+ else
413
+ build-extensions-binary : $(ensure-build-image ) build-extensions-binary-linux-amd64
414
+ endif
415
+
416
+ build-extensions-binary-linux-amd64 : $(ensure-build-image )
417
+ $(GO_BUILD_LINUX_AMD64 ) \
418
+ -tags $(GO_BUILD_TAGS ) -o $(go_build_base_path ) /cmd/extensions/bin/extensions.linux.amd64 \
419
+ $(go_rebuild_flags ) $(go_version_flags ) -installsuffix cgo $(agones_package ) /cmd/extensions
420
+ build-extensions-binary-linux-arm64 : $(ensure-build-image )
421
+ $(GO_BUILD_LINUX_ARM64 ) \
422
+ -tags $(GO_BUILD_TAGS ) -o $(go_build_base_path ) /cmd/extensions/bin/extensions.linux.arm64 \
423
+ $(go_rebuild_flags ) $(go_version_flags ) -installsuffix cgo $(agones_package ) /cmd/extensions
424
+
404
425
# Lint the go source code.
405
426
# use LINT_TIMEOUT to manipulate the linter timeout
406
427
lint : LINT_TIMEOUT ?= 15m
@@ -481,6 +502,34 @@ build-agones-sdk-binary-windows: $(ensure-build-image)
481
502
ensure-windows-buildx :
482
503
-docker buildx create --name=$(BUILDX_WINDOWS_BUILDER )
483
504
505
+ # Build the image for the gameserver extensions
506
+ build-extensions-image : build-extensions-image-amd64
507
+ ifeq ($(WITH_ARM64 ) , 1)
508
+ build-extensions-image : build-extensions-image-arm64
509
+ endif
510
+
511
+ build-extensions-image-amd64 : $(ensure-build-image ) build-extensions-binary build-licenses build-required-src-dist
512
+ docker build $(agones_path ) /cmd/extensions/ --tag=$(extensions_amd64_tag ) $(DOCKER_BUILD_ARGS )
513
+ # creating docker builder and then using that builder to build extensions image in buildx command
514
+ build-extensions-image-arm64 : $(ensure-build-image ) build-extensions-binary create-arm64-builder
515
+ docker buildx build --platform linux/arm64 --builder $(BUILDX_ARM64_BUILDER ) --build-arg ARCH=arm64 $(agones_path ) /cmd/extensions/ --tag=$(extensions_arm64_tag ) $(DOCKER_BUILD_ARGS )
516
+
517
+ # push the gameservers extensions image
518
+ push-extensions-image : push-extensions-image-amd64
519
+ ifeq ($(WITH_ARM64 ) , 1)
520
+ push-extensions-image : push-extensions-image-arm64
521
+ endif
522
+ # Ensure that extensions manifest is removed before creating new one.
523
+ -DOCKER_CLI_EXPERIMENTAL=enabled docker manifest rm $(extensions_tag)
524
+ DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create $(extensions_tag) $(push_extensions_manifest)
525
+ DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push $(extensions_tag)
526
+
527
+ # push extensions image
528
+ push-extensions-image-amd64 : build-extensions-image-amd64
529
+ docker push $(extensions_amd64_tag )
530
+ push-extensions-image-arm64 : build-extensions-image-arm64
531
+ $(MAKE ) DOCKER_BUILD_ARGS=--push build-extensions-image-arm64
532
+
484
533
# Build the image for the gameserver sidecar and SDK binaries
485
534
build-agones-sdk-image : $(ensure-build-image ) build-agones-sdk-binary build-licenses build-required-src-dist build-agones-sdk-image-amd64
486
535
ifeq ($(WITH_ARM64 ) , 1)
0 commit comments