github.com/technosophos/deis@v1.7.1-0.20150915173815-f9005256004b/controller/build.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  # fail on any command exiting non-zero
     4  set -eo pipefail
     5  
     6  if [[ -z $DOCKER_BUILD ]]; then
     7    echo
     8    echo "Note: this script is intended for use by the Dockerfile and not as a way to build the controller locally"
     9    echo
    10    exit 1
    11  fi
    12  
    13  # install required system packages
    14  # HACK: install git so we can install bacongobbler's fork of django-fsm
    15  apk add --update-cache \
    16    build-base \
    17    git \
    18    libffi-dev \
    19    libpq \
    20    openldap \
    21    openldap-dev \
    22    postgresql-dev \
    23    python \
    24    python-dev
    25  
    26  # install pip
    27  curl -sSL https://raw.githubusercontent.com/pypa/pip/7.0.3/contrib/get-pip.py | python -
    28  
    29  # add a deis user
    30  adduser deis -D -h /app -s /bin/bash
    31  
    32  # create a /app directory for storing application data
    33  mkdir -p /app && chown -R deis:deis /app
    34  
    35  # create directory for confd templates
    36  mkdir -p /templates && chown -R deis:deis /templates
    37  
    38  # install dependencies
    39  pip install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt
    40  
    41  # cleanup.
    42  apk del --purge \
    43    build-base \
    44    git \
    45    libffi-dev \
    46    openldap-dev \
    47    postgresql-dev \
    48    python-dev
    49  rm -rf /var/cache/apk/*