From f38d2996e986e88be27c89d1cf7c4e7498e6fc35 Mon Sep 17 00:00:00 2001 From: Jakob Schrettenbrunner Date: Wed, 21 Jun 2017 00:42:14 +0200 Subject: [PATCH] add vagrant setup --- .dev/vagrant/motd.txt | 8 ++++++++ .dev/vagrant/provision.sh | 31 +++++++++++++++++++++++++++++++ .gitignore | 3 +++ Vagrantfile | 9 +++++++++ 4 files changed, 51 insertions(+) create mode 100644 .dev/vagrant/motd.txt create mode 100644 .dev/vagrant/provision.sh create mode 100644 Vagrantfile diff --git a/.dev/vagrant/motd.txt b/.dev/vagrant/motd.txt new file mode 100644 index 0000000..f51c07d --- /dev/null +++ b/.dev/vagrant/motd.txt @@ -0,0 +1,8 @@ +##################################################### + Pterodactyl go Daemon Vagrant VM + +Gopath: /home/ubuntu/go +Daemon: /home/ubuntu/go/src/github.com/schrej/wings.go +Data: /srv/daemon-data + +##################################################### diff --git a/.dev/vagrant/provision.sh b/.dev/vagrant/provision.sh new file mode 100644 index 0000000..4036e1f --- /dev/null +++ b/.dev/vagrant/provision.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +echo "Provisioning development environment for Pterodactyl go daemon." +cp /home/ubuntu/go/github.com/schrej/wings.go/.dev/vagrant/motd.txt /etc/motd + +chown -R ubuntu:ubuntu /home/ubuntu/go + +echo "Update apt repositories" +sudo add-apt-repository ppa:longsleep/golang-backports +apt-get update > /dev/null + +echo "Install docker" +curl -sSL https://get.docker.com/ | sh +systemctl enable docker + +echo "Install go" +apt-get install -y golang-go +echo "export GOPATH=/home/ubuntu/go" >> /home/ubuntu/.profile +export GOPATH=/go +echo 'export PATH=$PATH:$GOPATH/bin' >> /home/ubuntu/.profile + +echo "Install go dep" +sudo -H -u ubuntu bash -c 'go get -u github.com/golang/dep/cmd/dep' + +echo "Install additional dependencies" +apt-get -y install mercurial #tar unzip make gcc g++ python > /dev/null + +echo " ------------" +echo "Gopath is /home/ubuntu/go" +echo "The project is mounted to /go/src/github.com/schrej/wings.go" +echo "Provisioning is completed." diff --git a/.gitignore b/.gitignore index e247664..18d708c 100644 --- a/.gitignore +++ b/.gitignore @@ -22,5 +22,8 @@ # ignore configuration file /config.json +# Ignore Vagrant stuff +/.vagrant + # Keep all gitkeep files (This needs to stay at the bottom) !.gitkeep diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..dba5462 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,9 @@ +Vagrant.configure("2") do |cfg| + cfg.vm.box = "ubuntu/xenial64" + + cfg.vm.synced_folder "./", "/home/ubuntu/go/src/github.com/schrej/wings.go" + + cfg.vm.provision :shell, path: ".dev/vagrant/provision.sh" + + cfg.vm.network :private_network, ip: "192.168.50.4" +end