From 8b9f8e190b8cf4f9f2677f832e5a9fd634eed8c1 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 2 May 2015 12:11:05 +0200 Subject: [PATCH] pandora vagrant setup --- .bzrignore | 3 +++ README | 12 ++++++++++++ Vagrantfile | 21 +++++++++++++++++++++ install.sh | 13 +++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 .bzrignore create mode 100644 README create mode 100644 Vagrantfile create mode 100755 install.sh diff --git a/.bzrignore b/.bzrignore new file mode 100644 index 0000000..a6d2f7a --- /dev/null +++ b/.bzrignore @@ -0,0 +1,3 @@ +pandora +pandora_install.log +.vagrant diff --git a/README b/README new file mode 100644 index 0000000..d067d46 --- /dev/null +++ b/README @@ -0,0 +1,12 @@ +Pan.do/ra Vagrant + +1) Install Vagrant (https://www.vagrantup.com/) +1) Checkout this repository +2) Setup Vagrant + + $ vagrant up + +3) Open Browser at http://localhost:2620/ +4) SSH into VM + + $ vagrant ssh diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..b59ae22 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,21 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! +VAGRANTFILE_API_VERSION = "2" + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + config.vm.hostname = 'pandora' + config.vm.guest = :ubuntu + config.package.name = 'pandora.box' + config.vm.box = 'trusty-cloud' + config.vm.box_url = 'https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box' + config.vm.network "forwarded_port", guest: 80, host: 2620 + config.vm.synced_folder ".", "/srv" + config.vm.provision "shell", path: "install.sh" + config.vm.provision :shell, :inline => "sudo /srv/pandora/ctl start", run: "always" + config.vm.provider "virtualbox" do |vb| + vb.customize ["modifyvm", :id, "--memory", "1024"] + vb.customize ['modifyvm', :id, '--cpus', '2'] + end +end diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..32a1dcf --- /dev/null +++ b/install.sh @@ -0,0 +1,13 @@ +#!/bin/bash +if [ -x /srv/pandora ]; then + sudo -H -u vagrant /srv/pandora/update.py dev +else + apt-get update -qq + apt-get install -y curl >/dev/null 2>&1 + curl https://wiki.0x2620.org/browser/pandora/vm/pandora_install.sh?format=txt > /vagrant/pandora_install.sh 2>/dev/null + echo "Installing pan.do/ra..." + echo "logging installation progress into pandora_install.log" + export PUSER=vagrant + /vagrant/pandora_install.sh >/vagrant/pandora_install.log 2>&1 + rm /vagrant/pandora_install.sh +fi