add wings environment

This commit is contained in:
Jakob Schrettenbrunner 2018-08-29 23:12:38 +02:00
parent a78da99516
commit a7840042ee
3 changed files with 49 additions and 0 deletions

16
Vagrantfile vendored
View File

@ -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"

View File

@ -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."

View File

@ -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