github.com/amrnt/deis@v1.3.1/database/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 database locally"
     9    echo
    10    exit 1
    11  fi
    12  
    13  # install postgresql 9.3 from postgresql.org repository as well as requirements for building wal-e
    14  echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" > /etc/apt/sources.list.d/pgdg.list
    15  curl -sk https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
    16  apt-get update && apt-get install -yq \
    17                                        curl \
    18                                        daemontools \
    19                                        file \
    20                                        gcc \
    21                                        git \
    22                                        libxml2-dev \
    23                                        libxslt1-dev \
    24                                        lzop \
    25                                        postgresql-9.3 \
    26                                        pv \
    27                                        python-dev
    28  
    29  /etc/init.d/postgresql stop
    30  
    31  # install pip
    32  curl -sSL https://raw.githubusercontent.com/pypa/pip/1.5.6/contrib/get-pip.py | python -
    33  
    34  # install wal-e
    35  cd /tmp
    36  git clone https://github.com/wal-e/wal-e.git
    37  
    38  cd /tmp/wal-e
    39  git checkout c16e58a
    40  
    41  pip install .
    42  
    43  mkdir -p /etc/wal-e.d/env
    44  
    45  chown -R root:postgres /etc/wal-e.d
    46  
    47  # cleanup. indicate that python, libpq and libyanl are required packages.
    48  apt-mark unmarkauto python curl daemontools file libxml2-dev \
    49    libxslt1-dev lzop postgresql-9.3 pv && \
    50    apt-get remove -y --purge python-dev gcc cpp libpq-dev libyaml-dev git && \
    51    apt-get autoremove -y --purge && \
    52    apt-get clean -y && \
    53    rm -Rf /usr/share/man /usr/share/doc && \
    54    rm -rf /tmp/* /var/tmp/* && \
    55    rm -rf /var/lib/apt/lists/*