Skip to content

cloudlena/clong

Repository files navigation

Clong

Go Report Card Build Status

A multiplayer game where players have to throw balls at targets from their smartphones.

  1. Open /screen on any big screen. This is where the game runs. The game should begin to spawn targets.
  2. Open / on any touch device and swipe forward to launch balls at the targets. Many players can play at the same time.
  3. Open /scoreboard to get a list of high scores (which updates live).

Resetting Scores

  1. Run the following command to reset the scoreboard (replacing PASSWORD with your actual admin password):
curl -X DELETE localhost:8080/api/scores -u 'admin:PASSWORD'

Build and Run Locally

  1. Run make
  2. Execute the created binary and visit http://localhost:8080

Run Tests

  1. Run make test

Build Container Image

The image is also available on Docker Hub.

  1. Run make build-docker

Run on Kubernetes

  1. Create a namespace and target it.
  2. Define a USERNAME and a PASSWORD for logging in.
  3. Define a DB_USERNAME and a DB_PASSWORD for clong to access the DB with.
  4. Create a secret called clong-credentials as follows:
kubectl create secret generic clong-credentials --from-literal=adminPassword="${PASSWORD}" --from-literal=dbUsername="${DB_USERNAME}" --from-literal=dbPassword="${DB_PASSWORD}"
  1. Insert your host instead of xxx in deployments/k8s/ing-clong.yml
  2. Apply the deployment as follows:
kubectl apply -f deployments/k8s

Run on Fly

  1. Run fly launch --config deployments/fly/fly.toml

Run on Cloud Foundry

  1. Create an SQL database service
  2. Modify deployments/cf/* to your liking
  3. Run make deploy-cf