Switch to unified view

a/vagrant/allura_setup.sh b/vagrant/allura_setup.sh
1
#!/bin/bash
1
#!/bin/bash
2
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
2
15
3
# Create log dir
16
# Create log dir
4
if [ ! -d /var/log/allura ]
17
if [ ! -d /var/log/allura ]
5
then
18
then
6
    sudo mkdir -p /var/log/allura
19
    sudo mkdir -p /var/log/allura
...
...
22
    cp /home/vagrant/.profile /home/vagrant/.bash_profile
35
    cp /home/vagrant/.profile /home/vagrant/.bash_profile
23
    echo -e "\n# Activate Allura virtualenv\n. /home/vagrant/anvil/bin/activate && cd /home/vagrant/src/forge" >> /home/vagrant/.bash_profile
36
    echo -e "\n# Activate Allura virtualenv\n. /home/vagrant/anvil/bin/activate && cd /home/vagrant/src/forge" >> /home/vagrant/.bash_profile
24
    chown vagrant:vagrant /home/vagrant/.bash_profile
37
    chown vagrant:vagrant /home/vagrant/.bash_profile
25
fi
38
fi
26
39
27
. /home/vagrant/anvil/bin/activate
40
# Setup Allura python packages
28
29
cd /home/vagrant/src/forge
41
cd /home/vagrant/src/forge
30
42
sudo -u vagrant bash -c '. /home/vagrant/anvil/bin/activate; ./rebuild.bash'
31
# 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
39
43
40
echo "Purging unneeded packages..."
44
echo "Purging unneeded packages..."
41
aptitude clean
45
aptitude clean
42
aptitude -y -q purge ri
46
aptitude -y -q purge ri
43
aptitude -y -q purge installation-report landscape-common wireless-tools wpasupplicant ubuntu-serverguide
47
aptitude -y -q purge installation-report landscape-common wireless-tools wpasupplicant
44
aptitude -y -q purge python-dbus libnl1 python-smartpm linux-headers-2.6.32-21-generic python-twisted-core libiw30
48
aptitude -y -q purge python-dbus libnl1 python-smartpm linux-headers-server python-twisted-core libiw30 language-selector-common
45
aptitude -y -q purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam libffi5
49
aptitude -y -q purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam accountsservice libaccountsservice0
46
50
47
echo "Zeroing free space to aid VM compression..."
51
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
49
dd if=/dev/zero of=/EMPTY bs=1M
55
dd if=/dev/zero of=/EMPTY bs=1M
50
rm -f /EMPTY
56
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