Virtual Machine appliance using Vagrant and puppet to auto provision a Civcraft-compatible testing machine
DISCLAIMER: Use of this VM appliance indicates you agree with Minecraft's EULA! If you don't, or don't know what I'm talking about, don't use this VM appliance until you do, and can agree with it.
My target for this is to get as far along the path to having a working, running Civcraft server at the end of the script as possible. What I have so far:
-
Basic VM provisioning
-
Java and other dependency installations (git, maven)
-
Minecraft server install
-
Minecraft server startup
-
Spigot server download
-
Spigot server replace Minecraft
with the core mods being in the hands of the developer -- for now. That's next.
I'll likely also add here first some how-tos in terms of getting mods set up that play nice with the server, and will submit refined versions to go in Dr_Jawa and/or Erocs' guides.
-
Get git: https://git-scm.com/downloads
-
Get Vagrant: https://www.vagrantup.com/downloads.html
-
Get VirtualBox: http://download.virtualbox.org/virtualbox/
-
(check LATEST.TXT for which to download)
-
Note that if you are running Windows 8, be warned that installing VirtualBox's bridge adapter may break standby and Windows 8 Fast Shutdown.
-
-
Install git (or one of the many GUI clients, ya wuss)
-
Install Vagrant (may require restart)
-
Install VirtualBox (will disconnect your internet, so log off Civcraft)
-
Clone this repository locally:
git clone [email protected]:ProgrammerDan/civcraft-vm.git
-
cd into that repository: cd civcraft-vm
-
Issue
vagrant up
. Note, this will take a long time so go do other things while waiting. -
SSH into vagrant:
[email protected]:2222
default passwordvagrant
-
Until automated, seek out other resources for setting up Civcraft.
-
The puppet provisioning issued by Vagrant (don't worry about the details) will handle most of the setup.
-
Minecraft 1.8.7 will be properly initialized
-
EULA will be accepted -- if you object to this, don't use this VM.
-
Spigot 1.8.7 will be built locally using BuildTools
-
Spigot will be installed as the minecraft_server.jar
-
Vanilla MC to Spigot conversion will occur.
-
-
Now, test your server by connecting to it: localhost:25565
Note: If you need to restart your Vagrant for any reason, issue "vagrant reload" at the host terminal.
- Proceed into installing Civcraft server mods.
-
Install Maven: https://maven.apache.org/download.cgi
-
Install a Java Development Environment
-
Eclipse is good: https://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/lunasr2
-
IntelliJ is good: https://www.jetbrains.com/idea/download/
-
Hardcore? Notepad++ is popular: https://notepad-plus-plus.org/download/
-
Textpad is a good hardcore for Windows: http://www.textpad.com/download/
-
Badass? Vim: http://www.vim.org/download.php or Emacs: http://www.gnu.org/software/emacs/#Obtaining
-
-
Install git if you haven't already: https://git-scm.com/downloads
-
Install spigot & craftbukkit into your maven repository:
mvn install:install-file -Dfile=./spigot/spigot-1.8.7.jar -DgroupId=org.spigotmc -DartifactId=spigot -Dversion=1.8.7 -Dpackaging=jar -DpomFile=./spigot/spigot-pom.xml
mvn install:install-file -Dfile=./spigot/craftbukkit-1.8.7.jar -DgroupId=org.bukkit -DartifactId=craftbukkit -Dversion=1.8.7 -Dpackaging=jar -DpomFile=./spigot/craftbukkit-pom.xml
Already done! Unlike your local machine, the dev environment has already installed spigot and craftbukkit compiled artifacts into the Maven repository, so you're ready to start developing out of the box.
-
Check out your favorite Civcraft mod and start hacking: https://github.com/Civcraft/
-
Most of them are "good" mods and after cloning them locally you can issue:
-
mvn clean package "-Dbuild.number=Local"
-
That builds the mod, and puts the output jar in ./target off the repository root.
-
The build.number stuff just gives a meaningful assignment to the incremental build number in the POM (maven details, go read up on it).
-
-
Drop the built jars into the vm's
/minecraft/plugins
folder and restart the minecraft server on the VM.
Note that currently, Namelayer and Citadel are in constant flux as Rourke and team work on Mercury / Sharding. The following is a stable plugin set:
CivModCore 1.0.3
NameLayer 2.3.5-136
Citadel 3.2.8-130
If you want to contribute to these plugins, you're going to need to go to most recent version on the plugin's master branch; I'll help you as I can.
-
Grab the latest CivModCore jar from the Civcraft build server, or build locally
-
Put the jar into
/minecraft/plugins
-
Continue.
-
Grab the latest jar from Civcraft build server, or build locally
-
Put the jar into
/minecraft/plugins
-
Start the server, observe the errors
-
Shut down the server.
-
Open
/minecraft/plugins/Namelayer/config.yml
-- note the need for username and password -
Install mysql --
sudo apt-get install mysql-server
- It's up to you if you want to set a root password; if you don't you'll be asked a bunch of times.
-
Log in to mysql --
mysql -uroot -p
with whatever password you set, or omit the-p
if you did not set one. -
Create namelayer credentials --
CREATE USER mc_namelayer IDENTIFIED BY 'minecraft';
-- clearly not high security here. -
Create a database for this user --
CREATE DATABASE IF NOT EXISTS namelayer
-
Give permission to use the database to your user --
GRANT ALL ON namelayer.* TO mc_namelayer
-
exit
the mysql shell. -
Test your user and database --
mysql namelayer -umc_namelayer -p
entering in passwordminecraft
-- if this gives no errors, you're ready to go. -
Go back to
/minecraft/plugins/Namelayer/config.yml
and edit it to look like this:sql: hostname: localhost port: 3306 dbname: namelayer username: 'mc_namelayer' password: 'minecraft' groups: enable: true
-
Restart the spigot server.
-
If there are tons of errors, let me know. Any such things are on my to-do to fix this.
-
Stop and restart spigot one last time.
-
If Namelayer is installed, just grab the latest jar from Civcraft build server, or build locally
-
Put the jar into
/minecraft/plugins
-
Start the server, observe the errors