To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / deploy / vagrant / start.sh @ 1590:c18460da6620

History | View | Annotate | Download (1.12 KB)

1 1581:ae8043b014c7 Chris
#!/bin/bash
2
3 1586:d0d59d12db94 Chris
mydir=$(dirname "$0")
4
5 1581:ae8043b014c7 Chris
dbpwd="$1"
6
if [ -z "$dbpwd" ]; then
7
    echo "Usage: $0 <database-password>" 1>&2
8
    exit 2
9
fi
10
11 1587:d8949733849d Chris
set -eu -o pipefail
12 1581:ae8043b014c7 Chris
13 1587:d8949733849d Chris
rootdir="$mydir/../.."
14 1586:d0d59d12db94 Chris
15 1587:d8949733849d Chris
deploydir="$rootdir"/deploy
16 1581:ae8043b014c7 Chris
if [ ! -d "$deploydir" ]; then
17 1586:d0d59d12db94 Chris
    echo "ERROR: Unexpected repository layout - expected directory at $deploydir"
18 1581:ae8043b014c7 Chris
    exit 2
19
fi
20
21
managerdir="$deploydir/vagrant"
22
if [ ! -d "$managerdir" ]; then
23
    echo "ERROR: Required directory $managerdir not found"
24
    exit 2
25
fi
26
27
configdir="$deploydir/config"
28
if [ ! -d "$configdir" ]; then
29
    echo "ERROR: Required directory $configdir not found"
30
    exit 2
31
fi
32
33 1586:d0d59d12db94 Chris
if [ ! -f "$rootdir/postgres-dumpall" ]; then
34
    echo "ERROR: I expect to find a Postgres SQL multi-db dump file in $rootdir/postgres-dumpall"
35
    exit 2
36
fi
37
38
fontdir="$rootdir"/public/themes/soundsoftware/stylesheets/fonts
39
if [ ! -f "$fontdir/24BC0E_0_0.woff" ]; then
40
    echo "ERROR: I expect to find necessary webfonts in $fontdir"
41 1581:ae8043b014c7 Chris
    exit 2
42
fi
43
44
for f in database.yml code.conf ; do
45 1587:d8949733849d Chris
    cat "$configdir/$f.in" |
46 1581:ae8043b014c7 Chris
        sed 's/INSERT_POSTGRES_PASSWORD_HERE/'"$dbpwd"'/g' > \
47 1587:d8949733849d Chris
            "$configdir/$f"
48 1581:ae8043b014c7 Chris
done
49
50
cd "$managerdir"
51
52
vagrant up