forked from deis/deis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·55 lines (44 loc) · 1.8 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env bash
# fail on any command exiting non-zero
set -eo pipefail
if [[ -z $DOCKER_BUILD ]]; then
echo
echo "Note: this script is intended for use by the Dockerfile and not as a way to build the database locally"
echo
exit 1
fi
# install postgresql 9.3 from postgresql.org repository as well as requirements for building wal-e
echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" > /etc/apt/sources.list.d/pgdg.list
curl -sk https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
apt-get update && apt-get install -yq \
curl \
daemontools \
file \
gcc \
git \
libxml2-dev \
libxslt1-dev \
lzop \
postgresql-9.3 \
pv \
python-dev
/etc/init.d/postgresql stop
# install pip
curl -sSL https://raw.githubusercontent.com/pypa/pip/6.0.8/contrib/get-pip.py | python -
# install wal-e
cd /tmp
git clone https://github.com/wal-e/wal-e.git
cd /tmp/wal-e
git checkout c16e58a
pip install .
mkdir -p /etc/wal-e.d/env
chown -R root:postgres /etc/wal-e.d
# cleanup. indicate that python, libpq and libyanl are required packages.
apt-mark unmarkauto python curl daemontools file libxml2-dev \
libxslt1-dev lzop postgresql-9.3 pv && \
apt-get remove -y --purge python-dev gcc cpp libpq-dev libyaml-dev git && \
apt-get autoremove -y --purge && \
apt-get clean -y && \
rm -Rf /usr/share/man /usr/share/doc && \
rm -rf /tmp/* /var/tmp/* && \
rm -rf /var/lib/apt/lists/*