From a7840042ee864a73c8c02067f7b4346bbabbdddc Mon Sep 17 00:00:00 2001 From: Jakob Schrettenbrunner Date: Wed, 29 Aug 2018 23:12:38 +0200 Subject: [PATCH 1/2] add wings environment --- Vagrantfile | 16 ++++++++++++++++ scripts/provision_wings.sh | 32 ++++++++++++++++++++++++++++++++ setup.sh | 1 + 3 files changed, 49 insertions(+) create mode 100644 scripts/provision_wings.sh diff --git a/Vagrantfile b/Vagrantfile index 964bbc9..5aa9a22 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -59,6 +59,21 @@ Vagrant.configure("2") do |config| SHELL end + config.vm.define "wings" do |wings| + wings.vm.hostname = "wings" + + wings.vm.box = "bento/ubuntu-18.04" + + wings.vm.synced_folder ".", "/vagrant", disabled: true + wings.vm.synced_folder "#{vagrant_root}/code/wings", "/home/vagrant/go/src/github.com/pterodactyl/wings", + owner: "vagrant", group: "vagrant" + + wings.vm.network :forwarded_port, guest: 8080, host: 58080 + wings.hostmanager.aliases = %w(wings.local) + + wings.vm.provision "provision", type: "shell", path: "#{vagrant_root}/scripts/provision_wings.sh" + end + config.vm.define "docs" do |docs| docs.vm.hostname = "documentation" docs.vm.synced_folder ".", "/vagrant", disabled: true @@ -78,6 +93,7 @@ Vagrant.configure("2") do |config| d.volumes = ["#{vagrant_root}/code/documentation:/srv/documentation:cached"] d.remains_running = true d.has_ssh = true + d.privileged = true end docs.vm.provision "deploy_files", type: "file", source: "#{vagrant_root}/build/configs", destination: "/tmp/.deploy" diff --git a/scripts/provision_wings.sh b/scripts/provision_wings.sh new file mode 100644 index 0000000..0d35b44 --- /dev/null +++ b/scripts/provision_wings.sh @@ -0,0 +1,32 @@ +#!/bin/bash +export DEBIAN_FRONTEND=noninteractive + +chown -R vagrant:vagrant /home/vagrant + +echo "Install docker, go and some dependencies" +apt-get -qq update +apt-get -qq -o=Dpkg::Use-Pty=0 upgrade +apt-get -qq -o=Dpkg::Use-Pty=0 install -y golang-go docker.io mercurial tar unzip make gcc g++ python + +usermod -aG docker vagrant + +echo "Setup GOPATH" +echo "export GOPATH=/home/vagrant/go" >> /home/vagrant/.profile +export GOPATH=/go +echo 'export PATH=$PATH:$GOPATH/bin' >> /home/vagrant/.profile + +echo "Install go dep" +sudo -H -u vagrant bash -c 'go get -u github.com/golang/dep/cmd/dep' +echo "Install delve for debugging" +sudo -H -u vagrant bash -c 'go get -u github.com/derekparker/delve/cmd/dlv' + +echo "Install ctop for fancy container monitoring" +wget https://github.com/bcicen/ctop/releases/download/v0.7.1/ctop-0.7.1-linux-amd64 -q -O /usr/local/bin/ctop +chmod +x /usr/local/bin/ctop + +echo "cd /home/vagrant/go/src/github.com/pterodactyl/wings " >> /home/vagrant/.profile + +echo " ------------" +echo "Gopath is /home/vagrant/go" +echo "The project is mounted to /home/vagrant/go/src/github.com/pterodactyl/wings" +echo "Provisioning is completed." \ No newline at end of file diff --git a/setup.sh b/setup.sh index 93ed46b..190a44e 100755 --- a/setup.sh +++ b/setup.sh @@ -9,6 +9,7 @@ vagrant plugin install vagrant-hostmanager cd $currentDirectory git clone https://github.com/pterodactyl/panel.git code/panel git clone https://github.com/pterodactyl/documentation.git code/documentation +git clone https://github.com/pterodactyl/wings.git code/wings # sudo gem install docker-sync # docker-sync start From 5ce6b4ef680b3eccb1f9f1bad15dd22697e5681f Mon Sep 17 00:00:00 2001 From: Jakob Schrettenbrunner Date: Wed, 29 Aug 2018 23:15:32 +0200 Subject: [PATCH 2/2] don't autostart wings environment --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 5aa9a22..cc7c991 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -59,7 +59,7 @@ Vagrant.configure("2") do |config| SHELL end - config.vm.define "wings" do |wings| + config.vm.define "wings", autostart: false do |wings| wings.vm.hostname = "wings" wings.vm.box = "bento/ubuntu-18.04"