From 71d1d8aac36ca6d5ce7b9f6b86a9891b45d3757c Mon Sep 17 00:00:00 2001 From: Folker Bernitt Date: Wed, 11 Feb 2015 10:39:53 +0100 Subject: (Re-)added auto setup of vagrant ssh. - Issues #282, #252 --- Vagrantfile | 5 +++++ provisioning/manifests/hackday.pp | 1 + .../pixelated/files/activate_custom_node_modules.sh | 10 ++++++++++ .../modules/pixelated/manifests/hackday_dev_env.pp | 14 ++++++++++++++ provisioning/modules/pixelated/manifests/source.pp | 12 ------------ 5 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 provisioning/manifests/hackday.pp create mode 100644 provisioning/modules/pixelated/manifests/hackday_dev_env.pp diff --git a/Vagrantfile b/Vagrantfile index da02c8bf..024a3517 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -55,6 +55,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.define "hackday", autostart: false do |hackday| config.vm.box = "hackday-pixelated-user-agent" + hackday.vm.provision "puppet" do |puppet| + puppet.manifests_path = "provisioning/manifests" + puppet.module_path = "provisioning/modules" + puppet.manifest_file = "hackday.pp" + end end if /mswin|mingw/ =~ RUBY_PLATFORM diff --git a/provisioning/manifests/hackday.pp b/provisioning/manifests/hackday.pp new file mode 100644 index 00000000..87a72728 --- /dev/null +++ b/provisioning/manifests/hackday.pp @@ -0,0 +1 @@ +class { '::pixelated::hackday_dev_env': } diff --git a/provisioning/modules/pixelated/files/activate_custom_node_modules.sh b/provisioning/modules/pixelated/files/activate_custom_node_modules.sh index ec59a183..5fa90b6a 100755 --- a/provisioning/modules/pixelated/files/activate_custom_node_modules.sh +++ b/provisioning/modules/pixelated/files/activate_custom_node_modules.sh @@ -27,4 +27,14 @@ fi source /home/vagrant/user-agent-venv/bin/activate +cd /vagrant/service +echo "running python setup.py develop" +python setup.py develop >/dev/null +echo "running bower install" +cd /vagrant/web-ui/ +bower install >/dev/null + +echo "running go build" +./go build + cd /vagrant diff --git a/provisioning/modules/pixelated/manifests/hackday_dev_env.pp b/provisioning/modules/pixelated/manifests/hackday_dev_env.pp new file mode 100644 index 00000000..78de0bba --- /dev/null +++ b/provisioning/modules/pixelated/manifests/hackday_dev_env.pp @@ -0,0 +1,14 @@ +# +class pixelated::hackday_dev_env { + file { '/home/vagrant/.activate_custom_node_modules.sh': + owner => 'vagrant', + mode => '0600', + source => 'puppet:///modules/pixelated/activate_custom_node_modules.sh', + } + exec { 'add_custom_node_modules_to_bashrc': + command => "/bin/bash -c 'echo \"source /home/vagrant/.activate_custom_node_modules.sh\" >> /home/vagrant/.bashrc'", + unless => "/bin/grep \"source /home/vagrant/.activate_custom_node_modules.sh\" /home/vagrant/.bashrc", + user => 'vagrant', + require => File['/home/vagrant/.activate_custom_node_modules.sh'] + } +} diff --git a/provisioning/modules/pixelated/manifests/source.pp b/provisioning/modules/pixelated/manifests/source.pp index e1dc7844..3d0fa390 100644 --- a/provisioning/modules/pixelated/manifests/source.pp +++ b/provisioning/modules/pixelated/manifests/source.pp @@ -36,18 +36,6 @@ class pixelated::source { user => 'vagrant', timeout => 0 } - - file { '/home/vagrant/.activate_custom_node_modules.sh': - owner => 'vagrant', - mode => '0600', - source => 'puppet:///modules/pixelated/activate_custom_node_modules.sh', - } - exec { 'add_custom_node_modules_to_bashrc': - command => "/bin/bash -c 'echo \"source /home/vagrant/.activate_custom_node_modules.sh\" >> /home/vagrant/.bashrc'", - unless => "/bin/grep \"source /home/vagrant/.activate_custom_node_modules.sh\" /home/vagrant/.bashrc", - user => 'vagrant', - require => [Exec['install-pixelated'], File['/home/vagrant/.activate_custom_node_modules.sh']] - } } Stage['main'] -> Stage['install_pixelated'] -- cgit v1.2.3