• 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

修订版c0c52d558c403c21370cf72f917140e05eb94e08 (tree)
时间2012-07-19 04:00:03
作者Tim Van Steenburgh <tvansteenburgh@gmai...>
CommiterTim Van Steenburgh

Log Message

Merge branch 'dev' of git://sfi-engr-scm-1/forge into dev

更改概述

差异

--- a/rebuild.bash
+++ b/rebuild.bash
@@ -1,7 +1,8 @@
1+#!/bin/bash
12 for APP in Allura* *Forge* NoWarnings
23 do
3- echo "# installing $APP dependencies"
4- pushd $APP
5- python setup.py develop || exit
6- popd
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
@@ -1,5 +1,18 @@
11 #!/bin/bash
22
3+# Install Solr
4+cd /home/vagrant/src
5+if [ ! -d apache-solr-1.4.1 ]
6+then
7+ echo "Installing Solr..."
8+ wget -q http://apache.mirrors.tds.net/lucene/solr/1.4.1/apache-solr-1.4.1.tgz
9+ tar xf apache-solr-1.4.1.tgz && rm -f apache-solr-1.4.1.tgz
10+ cd apache-solr-1.4.1/example/
11+ mkdir -p /home/vagrant/src/forge/solr_config/conf
12+ cp solr/conf/solrconfig.xml /home/vagrant/src/forge/solr_config/conf/
13+ chown -R vagrant:vagrant /home/vagrant/src/apache-solr* /home/vagrant/src/forge/solr_config/conf/
14+fi
15+
316 # Create log dir
417 if [ ! -d /var/log/allura ]
518 then
@@ -24,27 +37,30 @@ then
2437 chown vagrant:vagrant /home/vagrant/.bash_profile
2538 fi
2639
27-. /home/vagrant/anvil/bin/activate
28-
29-cd /home/vagrant/src/forge
30-
3140 # 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
41+cd /home/vagrant/src/forge
42+sudo -u vagrant bash -c '. /home/vagrant/anvil/bin/activate; ./rebuild.bash'
3943
4044 echo "Purging unneeded packages..."
4145 aptitude clean
4246 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
47+aptitude -y -q purge installation-report landscape-common wireless-tools wpasupplicant
48+aptitude -y -q purge python-dbus libnl1 python-smartpm linux-headers-server python-twisted-core libiw30 language-selector-common
49+aptitude -y -q purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam accountsservice libaccountsservice0
4650
4751 echo "Zeroing free space to aid VM compression..."
48-cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill
52+cat /dev/zero > zero.fill;
53+echo "Errors about 'No space left' are ok; carrying on..."
54+sync;sleep 1;sync;rm -f zero.fill
4955 dd if=/dev/zero of=/EMPTY bs=1M
5056 rm -f /EMPTY
57+echo "Done with allura_setup.sh"
58+
59+# sometimes mongo ends up stopped
60+# maybe due to that disk-filling exercise
61+# make sure it's still running
62+service mongodb status
63+if [ "$?" -ne "0" ]; then
64+ rm /var/lib/mongodb/mongod.lock
65+ service mongodb start
66+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
--- a/vagrant/start_allura
+++ b/vagrant/start_allura
@@ -12,18 +12,6 @@ then
1212 fi
1313 echo "Logs are in /var/log/allura"
1414
15-# Install Solr
16-cd /home/vagrant/src
17-if [ ! -d apache-solr-1.4.1 ]
18-then
19- echo "Installing Solr..."
20- wget -q http://apache.mirrors.tds.net/lucene/solr/1.4.1/apache-solr-1.4.1.tgz
21- tar xf apache-solr-1.4.1.tgz && rm -f apache-solr-1.4.1.tgz
22- cd apache-solr-1.4.1/example/
23- mkdir -p /home/vagrant/src/forge/solr_config/conf
24- cp solr/conf/solrconfig.xml /home/vagrant/src/forge/solr_config/conf/
25-fi
26-
2715 # Start solr
2816 if pgrep -f solr.*start.jar >/dev/null
2917 then