diff options
author | Pixpoa pairing <pixpoapairing@pixelated-project.org> | 2015-01-22 16:53:33 -0200 |
---|---|---|
committer | Pixpoa pairing <pixpoapairing@pixelated-project.org> | 2015-01-22 16:54:12 -0200 |
commit | ff2dfcc7f53eda09190089f8498177745afa6b26 (patch) | |
tree | 4d2c9f8d130410471b342f3c4d4eca6136e4d9c2 | |
parent | 86ed99a7d78e4690d103f4334dc0eef03c47e402 (diff) | |
parent | 895d1ae9e5d0260b3d55b352deab7be589d24a99 (diff) |
Merging wheezy-packages branch
-rw-r--r-- | Vagrantfile | 54 | ||||
-rwxr-xr-x | install-pixelated.sh | 22 | ||||
-rw-r--r-- | provisioning/modules/pixelated/manifests/apt.pp | 4 | ||||
-rw-r--r-- | provisioning/modules/pixelated/manifests/source.pp | 11 |
4 files changed, 83 insertions, 8 deletions
diff --git a/Vagrantfile b/Vagrantfile index 8c6ac69b..100bcb2a 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -9,8 +9,58 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # options are documented and commented below. For a complete reference, # please see the online documentation at vagrantup.com. - # Every Vagrant virtual environment requires a box to build off of. - config.vm.box = "wheezy" + # we need a debian testing vagrantbox because + # - currently the useragent debian packages depend on python-cryptography which is only + # available in debian jessie (for the fernet module to create keys) + # - the source installation needs npm, which is also only available in debian jessie + + # Please verify the sha512 sum of the downloaded box before importing it into vagrant ! + # see https://leap.se/en/docs/platform/details/development#Verify.vagrantbox.download + # for details + + config.vm.box = "leap-jessie-amd64" + config.vm.define "source", primary: true do |source| + source.vm.provider "virtualbox" do |v, override| + override.vm.box_url = "https://downloads.leap.se/platform/vagrant/virtualbox/leap-debian-jessie-amd64-virtualbox.box" + end + source.vm.provider "libvirt" do |v, override| + override.vm.box_url = "https://downloads.leap.se/platform/vagrant/libvirt/Debian-jessie.beta1-amd64-netboot.box" + end + source.vm.provision "puppet" do |puppet| + puppet.manifests_path = "provisioning/manifests" + puppet.module_path = "provisioning/modules" + puppet.manifest_file = "source.pp" + end + end + + config.vm.define "deb", autostart: false do |deb| + # until https://github.com/pixelated-project/pixelated-user-agent/issues/226 is not fixed, + # we depend on a debian testing box + + config.vm.box = "leap-jessie-amd64" + deb.vm.provider "virtualbox" do |v, override| + override.vm.box_url = "https://downloads.leap.se/platform/vagrant/virtualbox/leap-debian-jessie-amd64-virtualbox.box" + end + deb.vm.provider "libvirt" do |v, override| + override.vm.box_url = "https://downloads.leap.se/platform/vagrant/libvirt/Debian-jessie.beta1-amd64-netboot.box" + end + deb.vm.provision "puppet" do |puppet| + puppet.manifests_path = "provisioning/manifests" + puppet.module_path = "provisioning/modules" + puppet.manifest_file = "deb.pp" + end + end + + config.vm.define "hackday", autostart: false do |hackday| + config.vm.box = "hackday-user-agent" + end + + + config.vm.network :forwarded_port, guest: 3333, host: 3333 + config.vm.provider "virtualbox" do |v| + v.memory = 1024 + end +>>>>>>> master # Disable automatic box update checking. If you disable this, then # boxes will only be checked for updates when the user runs diff --git a/install-pixelated.sh b/install-pixelated.sh index fa6cd1e4..3e430783 100755 --- a/install-pixelated.sh +++ b/install-pixelated.sh @@ -24,6 +24,22 @@ then export USERNAME=`whoami` fi +usage() { echo "Usage: $0 [-v <virtualenv path>]" 1>&2; exit 1; } + +VIRTUALENV_PATH=".virtualenv" + +while getopts "v:" OPT; do + case "${OPT}" in + v) + VIRTUALENV_PATH=${OPTARG} + ;; + *) + usage + ;; + esac +done +shift $((OPTIND-1)) + function check_installed() { which $1 if [ $? -ne 0 ]; then @@ -46,9 +62,9 @@ LC_ALL=en_US.UTF-8 ./go build # install service dependencies cd ../service -rm -rf .virtualenv -virtualenv .virtualenv -source .virtualenv/bin/activate +rm -rf "$VIRTUALENV_PATH" +virtualenv "$VIRTUALENV_PATH" +source "$VIRTUALENV_PATH/bin/activate" ./go setup --always-unzip pip uninstall -y enum34 pip install enum34 diff --git a/provisioning/modules/pixelated/manifests/apt.pp b/provisioning/modules/pixelated/manifests/apt.pp index 434ae01e..e1af0aba 100644 --- a/provisioning/modules/pixelated/manifests/apt.pp +++ b/provisioning/modules/pixelated/manifests/apt.pp @@ -5,7 +5,7 @@ class pixelated::apt { file { '/etc/apt/sources.list.d/pixelated.list': content => "deb http://packages.pixelated-project.org/debian wheezy-snapshots main\ndeb http://packages.pixelated-project.org/debian wheezy main\n", owner => 'root', - require => Exec[add_pixelated_key], + require => Exec['add_pixelated_key'], notify => Exec['apt_get_update'], } @@ -25,7 +25,7 @@ class pixelated::apt { file { '/etc/apt/sources.list.d/leap.list': content => "deb http://deb.leap.se/0.6 wheezy main", owner => 'root', - require => Exec[add_pixelated_key], + require => Exec['add_leap_key'], notify => Exec['apt_get_update'], } file { '/tmp/0x1E34A1828E20790_leap_archive_key': diff --git a/provisioning/modules/pixelated/manifests/source.pp b/provisioning/modules/pixelated/manifests/source.pp index 8fd98dda..5ebec288 100644 --- a/provisioning/modules/pixelated/manifests/source.pp +++ b/provisioning/modules/pixelated/manifests/source.pp @@ -25,13 +25,22 @@ class pixelated::source { } class install_pixelated { + $virtualenv_path = "/home/vagrant/user-agent-venv" + exec { 'install-pixelated': environment => 'USERNAME=vagrant', - command => '/bin/bash /vagrant/install-pixelated.sh', + command => "/vagrant/install-pixelated.sh -v \"${virtualenv_path}\"", cwd => '/vagrant', user => 'vagrant', timeout => 0 } + + exec { 'add_virtualenv_to_bashrc': + command => "/bin/bash -c 'echo \"source ${virtualenv_path} ; cd /vagrant\" >> /home/vagrant/.bashrc'", + unless => "/bin/grep \"source ${virtualenv_path}\" /home/vagrant/.bashrc", + user => 'vagrant', + require => Exec['install-pixelated'] + } } Stage['main'] -> Stage['install_pixelated'] |