-
Notifications
You must be signed in to change notification settings - Fork 5
Local Development
You just need to have Docker installed to run The Agony Engine locally.
- Grab a copy of
docker-compose.yml
from the root of the project and put it in an empty directory on your computer. - Open a terminal and run:
docker-compose up
At this point Docker will download MySQL, ActiveMQ and The Agony Engine's containers from Docker Hub, configure them and start them up for you. When you see a message like Started AgonyEngine in 10.786 seconds (JVM running for 11.719)
in the log, point your browser at http://localhost:8080 and you should see the MUD's website.
Bear in mind that using this method the database will be stored inside the MySQL Docker container. When you shut everything down with docker-compose down
all the data will be deleted.
To preserve the data you will need to mount a directory from the host computer as a volume inside the MySQL container with the path /var/lib/mysql
. That way the database's files will be written outside of the Docker container and will remain even after the container is destroyed.
If you're interested in changing the code for The Agony Engine, it's pretty easy to get a development environment started. You'll need JDK 8 and Docker installed, and I'd strongly recommend a programmer's editor like IntelliJ IDEA.
- Clone the code from GitHub and make some changes.
- To build, type
./gradlew clean build
in the project root. - Wait for Gradle to build, run tests, build the Docker container and compute the test coverage.
- Run
docker-compose up
to start the MUD locally. You can connect a remote debugger to port 5005 of the container if you need to.
If you'd like to compile without running tests, you can run ./gradlew clean build -x check
. Doing so can greatly speed up your development cycle, but don't forget to run the tests before you open a pull request!
A typical pattern for iterating on a new feature would be to write some code, compile it, then run docker-compose up
to run it. Log in and play the game, try out your new feature, and Ctrl+C
to stop the game when you're done. At this point you can recompile and docker-compose up
again to bring it back up with your next set of changes.
If you find that you need to reset the database, run docker-compose down
to bring down all the Docker containers before running docker-compose up
. When it comes back up the database will be empty.