• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

allura


Commit MetaInfo

修订版41011296fd7b50ceb0e1049adc11745d4908dc25 (tree)
时间2012-07-19 03:58:58
作者Dave Brondsema <dbrondsema@geek...>
CommiterJenny Steele

Log Message

[#4539] Add solr port to port-forwarding; fixes for latest code/ubuntu

* remove old workaround that is no longer needed
* ensure files are owned by vagrant, not root
* update Ubuntu package references
* doc updates
* ensure mongo is running at the end

更改概述

差异

--- a/rebuild.bash
+++ b/rebuild.bash
@@ -1,7 +1,8 @@
1+#!/bin/bash
12 for APP in Allura* *Forge* NoWarnings
23 do
3- echo "# setting up $APP dependencies"
4- pushd $APP > /dev/null
5- python setup.py -q develop || exit
6- popd > /dev/null
4+ echo "# setting up $APP dependencies"
5+ pushd $APP > /dev/null
6+ python setup.py -q develop || exit
7+ popd > /dev/null
78 done
--- a/vagrant/README
+++ b/vagrant/README
@@ -4,10 +4,10 @@ $ mkdir ~/vagrant_allura && cd ~/vagrant_allura
44
55 # Get the base box
66 $ vagrant box add ubuntu-1110-server-amd64 http://timhuegdon.com/vagrant-boxes/ubuntu-11.10.box
7-$ vagrant init
7+$ vagrant init ubuntu-1110-server-amd64
88
99 # Get a copy of the provisioning scripts
10-$ cp /var/local/allura/vagrant/* .
10+$ cp -R /var/local/allura/vagrant/* .
1111
1212 # At this point you can make whatever changes you want to the provisioning
1313 # scripts
@@ -15,15 +15,18 @@ $ cp /var/local/allura/vagrant/* .
1515 # Provision the box (this will take a while)
1616 $ vagrant up
1717
18+# If you get an error, you can run `vagrant destroy` to start over
19+
1820 # Package the Allura box
1921 $ vagrant package --vagrantfile Vagrantfile.pkg
2022
2123 # Test your new box
22-$ mkdir ~/vagrant_allura_test and cd ~/vagrant_allura_test
24+$ mkdir ~/vagrant_allura_test && cd ~/vagrant_allura_test
2325 $ vagrant box add allura ~/vagrant_allura/package.box
24-$ vagrant init
26+$ vagrant init allura
27+$ vagrant up
2528 $ vagrant ssh
2629
2730 # Do whatever testing you want...
2831
29-# If everything checks out, you can rename your package.box and upload it
32+# If everything checks out, you can rename your package.box and upload it
--- a/vagrant/Vagrantfile
+++ b/vagrant/Vagrantfile
@@ -30,6 +30,7 @@ Vagrant::Config.run do |config|
3030 # Forward a port from the guest to the host, which allows for outside
3131 # computers to access the VM, whereas host only networking does not.
3232 config.vm.forward_port 8080, 8080
33+ config.vm.forward_port 8983, 8983 # solr
3334
3435 # Share an additional folder to the guest VM. The first argument is
3536 # an identifier, the second is the path on the guest to mount the
@@ -62,7 +63,7 @@ Vagrant::Config.run do |config|
6263 config.vm.provision :shell, :path => "allura_setup.sh"
6364
6465 # Enable provisioning with chef solo, specifying a cookbooks path, roles
65- # path, and data_bags path (all relative to this Vagrantfile), and adding
66+ # path, and data_bags path (all relative to this Vagrantfile), and adding
6667 # some recipes and/or roles.
6768 #
6869 # config.vm.provision :chef_solo do |chef|
--- a/vagrant/Vagrantfile.pkg
+++ b/vagrant/Vagrantfile.pkg
@@ -2,4 +2,5 @@ Vagrant::Config.run do |config|
22 # Forward Allura web port so you can browse the site at
33 # http://localhost:8080 (local port is the second number)
44 config.vm.forward_port 8080, 8080
5+ config.vm.forward_port 8983, 8983 # solr
56 end
--- a/vagrant/allura_setup.sh
+++ b/vagrant/allura_setup.sh
@@ -24,27 +24,30 @@ then
2424 chown vagrant:vagrant /home/vagrant/.bash_profile
2525 fi
2626
27-. /home/vagrant/anvil/bin/activate
28-
29-cd /home/vagrant/src/forge
30-
3127 # Setup Allura python packages
32-echo "Setting up Allura python packages..."
33-for APP in Allura* Forge* NoWarnings
34-do
35- pushd $APP
36- python setup.py develop
37- popd
38-done
28+cd /home/vagrant/src/forge
29+sudo -u vagrant bash -c '. /home/vagrant/anvil/bin/activate; ./rebuild.bash'
3930
4031 echo "Purging unneeded packages..."
4132 aptitude clean
4233 aptitude -y -q purge ri
43-aptitude -y -q purge installation-report landscape-common wireless-tools wpasupplicant ubuntu-serverguide
44-aptitude -y -q purge python-dbus libnl1 python-smartpm linux-headers-2.6.32-21-generic python-twisted-core libiw30
45-aptitude -y -q purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam libffi5
34+aptitude -y -q purge installation-report landscape-common wireless-tools wpasupplicant
35+aptitude -y -q purge python-dbus libnl1 python-smartpm linux-headers-server python-twisted-core libiw30 language-selector-common
36+aptitude -y -q purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam accountsservice libaccountsservice0
4637
4738 echo "Zeroing free space to aid VM compression..."
48-cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill
39+cat /dev/zero > zero.fill;
40+echo "Errors about 'No space left' are ok; carrying on..."
41+sync;sleep 1;sync;rm -f zero.fill
4942 dd if=/dev/zero of=/EMPTY bs=1M
5043 rm -f /EMPTY
44+echo "Done with allura_setup.sh"
45+
46+# sometimes mongo ends up stopped
47+# maybe due to that disk-filling exercise
48+# make sure it's still running
49+service mongodb status
50+if [ "$?" -ne "0" ]; then
51+ rm /var/lib/mongodb/mongod.lock
52+ service mongodb start
53+fi
--- a/vagrant/manifests/ubuntu-1110-server-amd64.pp
+++ b/vagrant/manifests/ubuntu-1110-server-amd64.pp
@@ -3,6 +3,10 @@ group { "puppet":
33 ensure => "present",
44 }
55
6+exec { "package index update":
7+ command => "/usr/bin/apt-get update",
8+}
9+
610 # install required system packages
711 Package { ensure => "installed" }
812
@@ -21,7 +25,9 @@ $packages = [
2125 "python-pip"
2226 ]
2327
24-package { $packages: }
28+package { $packages:
29+ require => Exec[ "package index update" ],
30+}
2531
2632 file { '/usr/lib/libz.so':
2733 ensure => 'link',
@@ -43,7 +49,7 @@ exec { "install venv":
4349
4450 # create Allura virtualenv
4551 exec { "create allura venv":
46- command => "/usr/local/bin/virtualenv --system-site-packages anvil && chown -R vagrant:vagrant /home/vagrant/anvil",
52+ command => "/usr/local/bin/virtualenv --system-site-packages anvil",
4753 cwd => "/home/vagrant",
4854 creates => "/home/vagrant/anvil",
4955 user => "vagrant",
@@ -75,21 +81,13 @@ exec { "clone repo":
7581 require => [ File[ "/home/vagrant/src" ], Package[ "git-core" ] ],
7682 }
7783
78-# pre-install Paste and PasteDeploy to work around problem in TG2 install
79-exec { "prereqs":
80- command => "/home/vagrant/anvil/bin/pip install Paste==1.7.5.1 PasteDeploy==1.5.0",
81- user => "vagrant",
82- group => "vagrant",
83- require => Exec[ "create allura venv" ],
84-}
85-
86-# install remainder of Allura dependencies
87-exec { "/usr/bin/sudo /home/vagrant/anvil/bin/pip install -r requirements.txt":
84+# install Allura dependencies
85+exec { "/home/vagrant/anvil/bin/pip install -r requirements.txt":
8886 cwd => "/home/vagrant/src/forge",
8987 user => "vagrant",
9088 group => "vagrant",
9189 timeout => 0,
92- require => [ Exec[ "clone repo"], Exec[ "prereqs" ] ],
90+ require => [ Exec[ "clone repo"], Exec[ "create allura venv" ] ],
9391 }
9492
9593 # create SCM repo dirs