github.com/deis/deis@v1.13.5-0.20170519182049-1d9e59fbdbfc/tests/fixtures/mock-store/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 store mock component locally"
     9    echo
    10    exit 1
    11  fi
    12  
    13  # install required packages to build
    14  apk add --no-cache \
    15    build-base \
    16    curl \
    17    file \
    18    gcc \
    19    git \
    20    openssl \
    21    python-dev
    22  
    23  # install etcdctl
    24  curl -sSL -o /usr/local/bin/etcdctl https://s3-us-west-2.amazonaws.com/get-deis/etcdctl-v0.4.9 \
    25    && chmod +x /usr/local/bin/etcdctl
    26  
    27  git clone https://github.com/jserver/mock-s3 /app/mock-s3
    28  cd /app/mock-s3
    29  #FIXME: This is a gisted patch to a known "good" version of mock-s3 to enable pseudo-handling of POST requests, otherwise wal-e crashes attempting to delete old wal segments
    30  git checkout 4c3c3752f990db97e8969c00666251a3b427ef4c
    31  git apply /tmp/mock-s3-patch.diff
    32  
    33  # install pip
    34  curl -sSL https://bootstrap.pypa.io/get-pip.py | python - pip==8.1.1
    35  
    36  python setup.py install
    37  
    38  # cleanup.
    39  apk del --no-cache \
    40    build-base \
    41    gcc \
    42    git
    43  rm -rf /tmp/*