Skip to content

Latest commit

 

History

History
133 lines (92 loc) · 5.17 KB

README.md

File metadata and controls

133 lines (92 loc) · 5.17 KB

gameon: The Root Repository / Quick start developers guide.

This is the TL;DR version. For more details/background/links, see: Intro to Game On! (GitBook)

As a prerequisite, make sure Java 8 is installed, and Docker is installed and running.

Local Room Development

  1. Obtain the source for this repository:
  • HTTPS: git clone https://github.com/gameontext/gameon.git
  • SSH: git clone [email protected]:gameontext/gameon.git
  1. Change to the gameon directory
cd gameon
  1. (Optional) Use Vagrant for your development environment
  2. Install Vagrant
  3. vagrant up (likley with --provider=virtualbox)
  4. vagrant ssh
  5. use pwd to ensure you're in the /vagrant directory.
  • Notes:
    • the Vagrantfile updates the .bashrc for the vagrant user to set DOCKER_MACHINE_NAME=vagrant to tweak script behavior for use with vagrant.
    • VM provisioning will perform the next two steps on your behalf. To toggle between Kubernetes via minikube and Docker Compose in the Vagrant VM, set the DEPLOYMENT environment variable at provisioning time.
  1. Set up required keystores and environment variables. This step also pulls the initial images required for running the system. (This action only needs to be run once).
./go-admin.sh setup
  • This script uses DEPLOYMENT to choose between using Docker Compose or Kubernetes for deployment.
    • DEPLOYMENT=docker-compose -- Scripts related to provisioning with Docker Compose are in the docker directory.
    • DEPLOYMENT=minikube -- Scripts related to provisioning with helm and kubernetes are in the kubernetes directory. Local deployment will be via minikube.
  1. Start the game (supporting platform and core services):
./go-admin.sh up
  • When using Docker Compose, this is a two step process, that can be emulated using:
./docker/go-platform-services.sh start
./docker/go-run.sh start
`./docker/go-run.sh` contains useful short-hand operations for working with docker containers defined by the yml files in the `docker` directory.

Game On! is now running locally.

When http://127.0.0.1/site_alive returns 200 OK, everything is up and running.

  • If you're running a *nix variant, you can access it at http://127.0.0.1/
  • If you're running Mac or Windows, access it using the docker host IP address (see below)

Carry on with building your rooms!


Core Game Development

If you want to contribute to the game's core services, no worries!

Assuming you've performed the steps above at least once (and using the map service as an example):

  1. Change to the gameon directory
cd gameon
  1. Obtain the source for the project that you want to change. The easiest way is to take advantage of git submodules.
git submodule init map
git submodule update map
  1. Copy the docker/docker-compose.override.yml.example file to docker/docker-compose.override.yml, and uncomment the section for the service you want to change:
map:
 build:
   context:  map/map-wlpcfg
 volumes:
  - '$HOME:$HOME'
  - 'keystore:/opt/ibm/wlp/usr/servers/defaultServer/resources/security'

The volume mapping in the $HOME directory is optional. If you're using a runtime like Liberty that supports incremental publish / hot swap, mapping in this volume ensures paths will resolve properly.

  1. Build the project(s) (includes building wars and creating keystores required for local development) to be deployed.
./docker/go-run.sh rebuild map
  1. Iterate!
  • For subsequent code changes to the same project:

    ./docker/go-run.sh rebuild map

  • To rebuild multiple projects, specify multiple projects as arguments, e.g.

    ./docker/go-run.sh rebuild map player auth

  • To rebuild all projects, use either:

    ./docker/go-run.sh rebuild or ./docker/go-run.sh rebuild all


Notes

Supporting 3rd party auth

3rd party authentication (twitter, github, etc.) will not work locally, but the anonymous/dummy user will. If you want to test with one of the 3rd party authentication providers, you'll need to set up your own tokens to do so (see gameon.env)

Use the right IP address

If you run on an operating system that uses a host VM for docker images (e.g. Docker Toolbox on Windows or Mac), then you need to update some values in gameon.env to match the IP address of your host. go-setup.sh will create a customized copy of gameon.env for the active DOCKER_MACHINE_NAME, that will perform the substitution to the host IP address returned by docker-machine ip <machine-name>.

Contributing

Want to help! Pile On!

Contributing to Game On!