Skip to content

Instantly share code, notes, and snippets.

@sapid
Last active February 15, 2018 20:56
Show Gist options
  • Save sapid/8364280bd6725c005b1a9e1e48b2d2e4 to your computer and use it in GitHub Desktop.
Save sapid/8364280bd6725c005b1a9e1e48b2d2e4 to your computer and use it in GitHub Desktop.
Vagrantfile for Siris
#!/usr/bin/env bash
# This copies updated files into the siris installation inside vagrant.
# If you want something that does this automatically, you can try using this script: https://gist.github.com/sapid/45c27ac2f9921c87072f12a20ae93d27
# You'll need inotify-tools installed for your system.
vagrant ssh -c "sudo -u siris rsync -ruv /mnt/siris-server/siris/ /home/siris/siris-dev/release-current/siris && sudo service apache2 restart"
Vagrant.configure("2") do |config|
config.vm.provider "virtualbox" do |v|
v.gui = false
v.memory = 2048
end
# Use this image for a clean full install with no cached packages
# config.vm.box = "ubuntu/trusty64"
config.vm.box = "siris-cached"
# Get it from gm-accelerator.xen.prgmr.com:~will/vagrant/siris-cached.box
# Then run vagrant box add siris-cached.box --name siris-cached
# config.vm.box_url = "scp://gm-accelerator.xen.prgmr.com:~will/vagrant/siris-cached.box"
config.vm.network "forwarded_port", guest: 22, host: 2222, host_ip: "127.0.0.1", id: 'ssh'
config.vm.network "forwarded_port", guest: 8110, host: 8110, host_ip: "127.0.0.1", id: 'http'
config.vm.network "forwarded_port", guest: 8000, host: 8111, host_ip: "127.0.0.1", id: 'runserver'
config.vm.synced_folder ".", "/mnt/siris-server", :mount_options => ["ro"]
config.vm.synced_folder "../feature-generator", "/mnt/feature-generator", :mount_options => ["ro"]
config.vm.define "siris"
config.vm.provider :virtualbox do |vb|
vb.name = "siris"
end
config.vm.provision "shell" do |s|
s.env = {
"APACHE_USER_NAME" => "www-data",
"APACHE_ROOT" => "/srv/www",
"APACHE_CONF_DIR" => "/etc/apache2/sites-available",
"APACHE_PORT" => 8110,
"DB_NAME" => "db.sqlite3",
"ENV_TYPE" => "stage",
"SRC_ROOT" => "/mnt/siris-server",
"FEATUREGEN_SRC_ROOT" => "/mnt/feature-generator",
"INSTALL_ROOT" => "/home/siris",
"DEPLOY_ROOT" => "/home/siris",
"SIRIS_SCRIPT_DIR" => "/home/siris/scripts",
"INSTALL_SCRIPT_PATH" => "/mnt/siris-server/scripts/install-siris-linux.sh",
"APP_NAME" => "siris-dev",
"PRODUCT_CODES" => "qp,qm",
"INSTITUTION_ID_NUMBER" => 5,
"VHOST" => "127.0.0.1",
"SUPERUSER_EMAIL" => "jess@greenmars.consulting",
"SUPERUSER_PASS" => "Hunter2",
"IS_DEBUG" => "true",
}
s.inline = '/bin/bash /mnt/siris-server/scripts/install-siris-linux.sh 2>&1 /home/vagrant/siris-install.log'
s.name = "Deploying Siris"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment