-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·44 lines (34 loc) · 1.48 KB
/
build.sh
File metadata and controls
executable file
·44 lines (34 loc) · 1.48 KB
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
#!/usr/bin/env bash
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 controller locally"
echo
exit 1
fi
DEBIAN_FRONTEND=noninteractive
# install required system packages
# HACK: install git so we can install bacongobbler's fork of django-fsm
# install openssh-client for temporary fleetctl wrapper
apt-get update && \
apt-get install -yq python-dev libpq-dev libyaml-dev git
# install pip
curl -sSL https://raw.githubusercontent.com/pypa/pip/1.5.6/contrib/get-pip.py | python -
# add a deis user that has passwordless sudo (for now)
useradd deis --groups sudo --home-dir /app --shell /bin/bash
sed -i -e 's/%sudo\tALL=(ALL:ALL) ALL/%sudo\tALL=(ALL:ALL) NOPASSWD:ALL/' /etc/sudoers
# create a /app directory for storing application data
mkdir -p /app && chown -R deis:deis /app
# create directory for confd templates
mkdir -p /templates && chown -R deis:deis /templates
# create directory for logs
mkdir -p /var/log/deis && chown -R deis:deis /var/log/deis
# install dependencies
pip install -r /app/requirements.txt
# cleanup. indicate that python, libpq and libyanl are required packages.
apt-mark unmarkauto python python-openssl libpq5 libpython2.7 libyaml-0-2 && \
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/*