-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·59 lines (48 loc) · 1.99 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
56
57
58
59
#!/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 \
g++ \
git \
libffi-dev \
libxml2-dev \
libxslt1-dev \
libssl-dev \
lzop \
postgresql-9.3 \
pv \
python-dev
/etc/init.d/postgresql stop
# install pip
curl -sSL https://raw.githubusercontent.com/pypa/pip/6.1.1/contrib/get-pip.py | python -
# install wal-e
cd /tmp
git clone https://github.com/wal-e/wal-e.git
# get a post-v0.8.0 commit which includes a busybox fix
cd /tmp/wal-e
git checkout c6dd4b1
pip install .
mkdir -p /etc/wal-e.d/env
chown -R root:postgres /etc/wal-e.d
# cleanup. indicate python, curl, and others as required packages.
apt-mark unmarkauto python curl daemontools file libffi-dev libxml2-dev \
libxslt1-dev libssl-dev lzop postgresql-9.3 pv && \
apt-get remove -y --purge gcc g++ git python-dev && \
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/*