-
Notifications
You must be signed in to change notification settings - Fork 800
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
964 additions
and
333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copyright 2024 Google LLC All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Build the Go image from source | ||
FROM golang:1.22.6 AS build-stage | ||
|
||
WORKDIR /agones.dev | ||
|
||
COPY *.go ./ | ||
|
||
# Note: because this installs the most recently released version of Agones, this will need to be | ||
# built and pushed post-release. | ||
# TODO: Add to post-release check list. | ||
RUN go mod init agones.dev/agones/test/sdk/go/sdk-client-test | ||
RUN go mod tidy | ||
RUN go mod download | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux go build -o /sdk-client-test | ||
|
||
# Copy the above binary into a lean image | ||
FROM gcr.io/distroless/static-debian12:nonroot AS build-release-stage | ||
|
||
WORKDIR / | ||
|
||
COPY --from=build-stage /sdk-client-test /sdk-client-test | ||
|
||
USER nonroot:nonroot | ||
|
||
ENTRYPOINT ["/sdk-client-test"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Copyright 2024 Google LLC All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# | ||
# Makefile for building a test game-server | ||
# | ||
|
||
# __ __ _ _ _ | ||
# \ \ / /_ _ _ __(_) __ _| |__ | | ___ ___ | ||
# \ \ / / _` | '__| |/ _` | '_ \| |/ _ \ __| | ||
# \ V / (_| | | | | (_| | |_) | | __\__ \ | ||
# \_/ \__,_|_| |_|\__,_|_.__/|_|\___|___/ | ||
# | ||
|
||
REGISTRY ?= | ||
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) | ||
project_path := $(dir $(mkfile_path)) | ||
root_path = $(realpath $(project_path)/) | ||
# Because go mod init in the Dockerfile installs the most recently released version of Agones, this | ||
# will need to be built and pushed post-release. During DEV it will be built at DEV - 1. | ||
base_version = 1.43.0 | ||
server_tag := $(REGISTRY)/sdk-client-test:$(base_version) | ||
|
||
# _____ _ | ||
# |_ _|_ _ _ __ __ _ ___| |_ ___ | ||
# | |/ _` | '__/ _` |/ _ \ __/ __| | ||
# | | (_| | | | (_| | __/ |_\__ \ | ||
# |_|\__,_|_| \__, |\___|\__|___/ | ||
# |___/ | ||
|
||
# Build a docker image for the server, and tag it | ||
build: | ||
cd $(root_path) && docker build -f $(project_path)Dockerfile --tag=$(server_tag) . | ||
|
||
push: build | ||
docker push $(server_tag) | ||
|
||
# build and push the sdk-client-test image with specified tag | ||
cloud-build: | ||
cd $(root_path) && gcloud builds submit --config=cloudbuild.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
# Copyright 2024 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
steps: | ||
# | ||
# Creates the initial make + docker build platform | ||
# | ||
- name: ubuntu | ||
script: | | ||
echo 'FROM gcr.io/cloud-builders/docker:24.0.6\nRUN apt-get install make\nENTRYPOINT [\"/usr/bin/make\"]' > Dockerfile.build | ||
- name: gcr.io/cloud-builders/docker:24.0.6 | ||
id: build-make-docker | ||
entrypoint: docker | ||
args: [build, -f, Dockerfile.build, -t, make-docker, .] | ||
|
||
# build and push sdk-client-test image to Google Artifact Registry | ||
- name: make-docker | ||
id: push | ||
dir: . | ||
env: ['REGISTRY=${_REGISTRY}'] | ||
script: | | ||
make push | ||
options: | ||
dynamic_substitutions: true | ||
substitutions: | ||
_REGISTRY: us-docker.pkg.dev/${PROJECT_ID}/ci | ||
timeout: 1800s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.