Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate confirming example images are on gcr.io #1207

Merged
merged 3 commits into from
Dec 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ include ./includes/kind.mk
include ./includes/website.mk
include ./includes/sdk.mk
include ./includes/allocation.mk
include ./includes/examples.mk

# _____ _
# |_ _|_ _ _ __ __ _ ___| |_ ___
Expand Down
33 changes: 33 additions & 0 deletions build/includes/examples.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2019 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.

#
# Include for managing the examples
#

# _____ _
# |_ _|_ _ _ __ __ _ ___| |_ ___
# | |/ _` | '__/ _` |/ _ \ __/ __|
# | | (_| | | | (_| | __/ |_\__ \
# |_|\__,_|_| \__, |\___|\__|___/
# |___/

# test all example images exist on Google Cloud Registry
test-examples-on-gcr: example-image-test.autoscaler-webhook example-image-test.cpp-simple
test-examples-on-gcr: example-image-test.nodejs-simple example-image-test.rust-simple example-image-test.simple-tcp
test-examples-on-gcr: example-image-test.simple-udp example-image-test.unity-simple example-image-test.xonotic

# Test to ensure the example image found in the % folder is on GCR. Fails if it is not.
example-image-test.%:
$(DOCKER_RUN) bash -c "cd examples/$* && make gcr-check"
2 changes: 1 addition & 1 deletion docs/governance/templates/release_issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ and copy it into a release issue. Fill in relevant values, found inside {}
- [ ] Ensure the [helm `tag` value][values] is correct (should be the {version} if a full release, {version}-rc if release candidate)
- [ ] Ensure the [helm `Chart` version values][chart] are correct (should be the {version} if a full release, {version}-rc if release candidate)
- [ ] Run `make gen-install`
- [ ] Ensure all example images exist on gcr.io/agones-images-
- [ ] Run `test-examples-on-gcr` to ensure all example images exist on gcr.io/agones-images-
- [ ] Create a *draft* release with the [release template][release-template]
- [ ] Make a `tag` with the release version.
- [ ] Site updated
Expand Down
4 changes: 4 additions & 0 deletions examples/autoscaler-webhook/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ root_path = $(realpath $(project_path)/../..)
# Build a docker image for the server, and tag it
build:
cd $(root_path) && docker build -f $(project_path)/Dockerfile --tag=$(autoscaler_webhook_tag) .

# check if hosted on Google Cloud Registry
gcr-check:
gcloud container images describe $(autoscaler_webhook_tag)
4 changes: 4 additions & 0 deletions examples/cpp-simple/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ root_path = $(realpath $(project_path)/../..)
# build the cpp-simple binary
build:
cd $(root_path) && docker build -f $(project_path)/Dockerfile --tag=$(server_tag) .

# check if hosted on Google Cloud Registry
gcr-check:
gcloud container images describe $(server_tag)
6 changes: 5 additions & 1 deletion examples/nodejs-simple/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@ build:
cd $(root_path) && docker build -f $(project_path)/Dockerfile --tag=$(server_tag) .

run:
docker run --network=host $(server_tag)
docker run --network=host $(server_tag)

# check if hosted on Google Cloud Registry
gcr-check:
gcloud container images describe $(server_tag)
4 changes: 4 additions & 0 deletions examples/rust-simple/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,7 @@ clean:
# clean leftover files after building an image with Docker
clean-docker:
rm -rf $(project_path)sdk

# check if hosted on Google Cloud Registry
gcr-check:
gcloud container images describe $(server_tag)
4 changes: 4 additions & 0 deletions examples/simple-tcp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ root_path = $(realpath $(project_path)/../..)
# Build a docker image for the server, and tag it
build:
cd $(root_path) && docker build -f $(project_path)/Dockerfile --tag=$(server_tag) .

# check if hosted on Google Cloud Registry
gcr-check:
gcloud container images describe $(server_tag)
4 changes: 4 additions & 0 deletions examples/simple-udp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ root_path = $(realpath $(project_path)/../..)
# Build a docker image for the server, and tag it
build:
cd $(root_path) && docker build -f $(project_path)/Dockerfile --tag=$(server_tag) .

# check if hosted on Google Cloud Registry
gcr-check:
gcloud container images describe $(server_tag)
6 changes: 5 additions & 1 deletion examples/unity-simple/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@ server_tag = $(REPOSITORY)/unity-simple-server:0.3
# |___/

build-image:
docker build $(project_path) --tag=$(server_tag)
docker build $(project_path) --tag=$(server_tag)

# check if hosted on Google Cloud Registry
gcr-check:
gcloud container images describe $(server_tag)
4 changes: 4 additions & 0 deletions examples/xonotic/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ image_tag = $(REPOSITORY)/xonotic-example:0.7
# Build a docker image for the server, and tag it
build:
cd $(root_path) && docker build -f $(project_path)/Dockerfile --tag=$(image_tag) .

# check if hosted on Google Cloud Registry
gcr-check:
gcloud container images describe $(image_tag)