Skip to content

Latest commit

 

History

History
67 lines (49 loc) · 2.38 KB

COMMANDS.md

File metadata and controls

67 lines (49 loc) · 2.38 KB

These are some additional commands which are useful for development.

Generate components file:

go generate github.com/googleforgames/space-agon/game/generation

Rebuild proto generates files:

docker build -f=Dockerfile.build-protos -t build-protos . && docker run --rm --mount type=bind,source="$(pwd)",target=/workdir/mount build-protos

Mother of all commands:


# Once
docker build -f=Dockerfile.build-protos -t build-protos . 

# Every update

go generate github.com/googleforgames/space-agon/game/generation && \
docker run --rm --mount type=bind,source="$(pwd)",target=/workdir/mount build-protos && \
TAG=$(date +INDEV-%Y%m%d-%H%M%S) && \
REGISTRY=gcr.io/$(gcloud config list --format 'value(core.project)') && \
GOOS=js GOARCH=wasm go test github.com/googleforgames/space-agon/client/... && \
go test github.com/googleforgames/space-agon/...





 && \
docker build . -f Frontend.Dockerfile -t $REGISTRY/space-agon-frontend:$TAG && \
docker build . -f Dedicated.Dockerfile -t $REGISTRY/space-agon-dedicated:$TAG && \
docker build . -f Director.Dockerfile -t $REGISTRY/space-agon-director:$TAG && \
docker build . -f Mmf.Dockerfile -t $REGISTRY/space-agon-mmf:$TAG && \
docker push $REGISTRY/space-agon-frontend:$TAG && \
docker push $REGISTRY/space-agon-dedicated:$TAG && \
docker push $REGISTRY/space-agon-director:$TAG && \
docker push $REGISTRY/space-agon-mmf:$TAG && \
ESC_REGISTRY=$(echo $REGISTRY | sed -e 's/\\/\\\\/g; s/\//\\\//g; s/&/\\\&/g') && \
ESC_TAG=$(echo $TAG | sed -e 's/\\/\\\\/g; s/\//\\\//g; s/&/\\\&/g') && \
sed -E 's/image: (.*)\/([^\/]*):(.*)/image: '$ESC_REGISTRY'\/\2:'$ESC_TAG'/' deploy_template.yaml > deploy.yaml && \
kubectl apply -f deploy.yaml

Run locally

# Gameserver - RUN FIRST

go generate github.com/googleforgames/space-agon/game/generation && \
docker run --rm --mount type=bind,source="$(pwd)",target=/workdir/mount build-protos && \
go test github.com/googleforgames/space-agon/... && \
docker build . -f Dedicated.Dockerfile -t space-agon-dedicated && \
docker run -p 2156:2156/tcp -e DISABLE_AGONES=true space-agon-dedicated

# Frontend - RUN SECOND

GOOS=js GOARCH=wasm go test github.com/googleforgames/space-agon/client/... && \
go test github.com/googleforgames/space-agon/... && \
docker build . -f Frontend.Dockerfile -t space-agon-frontend && \
docker run -p 2157:8080/tcp space-agon-frontend

This is not an officially supported Google product.