A Battlesnake AI written in Java.
Visit https://docs.battlesnake.io for API documentation and instructions for running your AI.
This snake is built using a lightweight http server Spark framework - http://sparkjava.com/documentation
- Install JDK 8 http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
- Install Maven https://maven.apache.org/install.html
mvn compile exec:exec
Snake will start up on port 8080
This snake has also been run from within Intellij successfully.
mvn compile test
mvn compile package
Will result in a jar file in target
called manedev79-hungry-snake.jar
You can then run this file with the command
java -jar target/manedev79-hungry-snake.jar
- Create a new Heroku app:
heroku create [APP_NAME]
- Deploy code to Heroku servers:
git push heroku master
- Open Heroku app in browser:
heroku open
or visit http://APP_NAME.herokuapp.com.
- View server logs with the
heroku logs
command:
heroku logs --tail
Build docker image and uplaod to docker.io.
Note: Customize with your dockerhub user!
mvn compile jib:build
kubectl apply -f k8s/
Verify the snake is up
curl -kL --request POST localhost/hungry-snake/ping