To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / extra / soundsoftware / vagranttest / provision.d @ 1577:e38eee2e1d47
| 1 | 1577:e38eee2e1d47 | Chris | #!/bin/bash |
|---|---|---|---|
| 2 | |||
| 3 | set -e |
||
| 4 | |||
| 5 | apt-get update && \ |
||
| 6 | apt-get install -y \ |
||
| 7 | apache2 \ |
||
| 8 | apache2-dev \ |
||
| 9 | apt-utils \ |
||
| 10 | build-essential \ |
||
| 11 | cron \ |
||
| 12 | curl \ |
||
| 13 | doxygen \ |
||
| 14 | exim4 \ |
||
| 15 | git \ |
||
| 16 | graphviz \ |
||
| 17 | imagemagick \ |
||
| 18 | libapache-dbi-perl \ |
||
| 19 | libapache2-mod-perl2 \ |
||
| 20 | libapr1-dev \ |
||
| 21 | libaprutil1-dev \ |
||
| 22 | libauthen-simple-ldap-perl \ |
||
| 23 | libcurl4-openssl-dev \ |
||
| 24 | libdbd-pg-perl \ |
||
| 25 | libpq-dev \ |
||
| 26 | libmagickwand-dev \ |
||
| 27 | libio-socket-ssl-perl \ |
||
| 28 | logrotate \ |
||
| 29 | mercurial \ |
||
| 30 | postgresql \ |
||
| 31 | rsync \ |
||
| 32 | ruby \ |
||
| 33 | ruby-dev \ |
||
| 34 | sudo |
||
| 35 | #!/bin/bash |
||
| 36 | |||
| 37 | set -e |
||
| 38 | |||
| 39 | # Passenger gets installed through gem, not apt |
||
| 40 | |||
| 41 | if [ ! -f /var/lib/gems/2.3.0/gems/passenger-4.0.60/buildout/apache2/mod_passenger.so ]; then |
||
| 42 | gem install passenger -v 4.0.60 --no-rdoc --no-ri |
||
| 43 | passenger-install-apache2-module --languages=ruby |
||
| 44 | fi |
||
| 45 | |||
| 46 | #!/bin/bash |
||
| 47 | |||
| 48 | set -e |
||
| 49 | |||
| 50 | if ! grep -q '^code:' /etc/passwd ; then |
||
| 51 | groupadd code |
||
| 52 | useradd -g code -G www-data code |
||
| 53 | fi |
||
| 54 | |||
| 55 | #!/bin/bash |
||
| 56 | |||
| 57 | set -e |
||
| 58 | |||
| 59 | if [ ! -d /var/www/code ]; then |
||
| 60 | cp -a /vagrant-code /var/www/code |
||
| 61 | chown -R code.www-data /var/www/code |
||
| 62 | find /var/www/code -type d -exec chmod g+s \{\} \;
|
||
| 63 | fi |
||
| 64 | |||
| 65 | #!/bin/bash |
||
| 66 | |||
| 67 | set -e |
||
| 68 | |||
| 69 | if [ ! -f /var/hg/index.cgi ]; then |
||
| 70 | mkdir -p /var/hg |
||
| 71 | chown code.www-data /var/hg |
||
| 72 | chmod g+s /var/hg |
||
| 73 | cp /var/www/code/extra/soundsoftware/dockertest/index.cgi /var/hg/ |
||
| 74 | cp /var/www/code/extra/soundsoftware/dockertest/hgweb.config /var/hg/ |
||
| 75 | chmod +x /var/hg/index.cgi |
||
| 76 | fi |
||
| 77 | |||
| 78 | #!/bin/bash |
||
| 79 | |||
| 80 | set -e |
||
| 81 | |||
| 82 | #!!! This will fail until we have the user-supplied password |
||
| 83 | #!!! interpolation logic (also the path is silly) |
||
| 84 | |||
| 85 | if [ ! -f /var/www/code/config/database.yml ]; then |
||
| 86 | cp /var/www/code/extra/soundsoftware/dockertest/database.yml.interpolated \ |
||
| 87 | /var/www/code/config/database.yml |
||
| 88 | fi |
||
| 89 | |||
| 90 | #!/bin/bash |
||
| 91 | |||
| 92 | set -e |
||
| 93 | |||
| 94 | cd /var/www/code |
||
| 95 | gem install bundler |
||
| 96 | bundle install |
||
| 97 | |||
| 98 | #!/bin/bash |
||
| 99 | |||
| 100 | set -e |
||
| 101 | |||
| 102 | cd /var/www/code |
||
| 103 | bundle exec rake generate_secret_token |
||
| 104 | |||
| 105 | #!/bin/bash |
||
| 106 | |||
| 107 | set -e |
||
| 108 | |||
| 109 | /etc/init.d/postgresql start |
||
| 110 | |||
| 111 | cd /var/www/code |
||
| 112 | |||
| 113 | if [ -f postgres-dumpall ]; then |
||
| 114 | chmod ugo+r postgres-dumpall |
||
| 115 | sudo -u postgres psql -f postgres-dumpall postgres |
||
| 116 | rm postgres-dumpall # This was just a copy of the shared folder file anyway |
||
| 117 | fi |
||
| 118 | |||
| 119 | |||
| 120 | |||
| 121 | #!/bin/bash |
||
| 122 | |||
| 123 | set -e |
||
| 124 | |||
| 125 | if [ ! -f /usr/local/lib/site_perl/Apache/Authn/SoundSoftware.pm ]; then |
||
| 126 | mkdir -p /usr/local/lib/site_perl/Apache/Authn/ |
||
| 127 | cp /var/www/code/extra/soundsoftware/SoundSoftware.pm /usr/local/lib/site_perl/Apache/Authn/ |
||
| 128 | fi |
||
| 129 | |||
| 130 | #!/bin/bash |
||
| 131 | |||
| 132 | set -e |
||
| 133 | |||
| 134 | cd /var/www/code |
||
| 135 | |||
| 136 | #!!! This will fail until we have the user-supplied password |
||
| 137 | #!!! interpolation logic (also the source paths are silly) |
||
| 138 | |||
| 139 | if [ ! -f /etc/apache2/sites-enabled/10-code.conf ]; then |
||
| 140 | |||
| 141 | rm -f /etc/apache2/sites-enabled/000-default.conf |
||
| 142 | |||
| 143 | cp extra/soundsoftware/dockertest/passenger.conf /etc/apache2/mods-available/ |
||
| 144 | cp extra/soundsoftware/dockertest/passenger.load /etc/apache2/mods-available/ |
||
| 145 | cp extra/soundsoftware/dockertest/perl.conf /etc/apache2/mods-available/ |
||
| 146 | |||
| 147 | ln -s ../mods-available/passenger.conf /etc/apache2/mods-enabled/ |
||
| 148 | ln -s ../mods-available/passenger.load /etc/apache2/mods-enabled/ |
||
| 149 | ln -s ../mods-available/perl.conf /etc/apache2/mods-enabled/ |
||
| 150 | ln -s ../mods-available/expires.load /etc/apache2/mods-enabled/ |
||
| 151 | ln -s ../mods-available/rewrite.load /etc/apache2/mods-enabled/ |
||
| 152 | |||
| 153 | cp extra/soundsoftware/dockertest/code.conf.interpolated /etc/apache2/sites-available/code.conf |
||
| 154 | ln -s ../sites-available/code.conf /etc/apache2/sites-enabled/10-code.conf |
||
| 155 | |||
| 156 | apache2ctl configtest |
||
| 157 | |||
| 158 | fi |