github.com/greenboxal/deis@v1.12.1/mesos/build-marathon-jar.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 marathon locally"
     9    echo
    10    exit 1
    11  fi
    12  
    13  # shellcheck disable=SC2034
    14  DEBIAN_FRONTEND=noninteractive
    15  
    16  apt-get update && apt-get install --no-install-recommends -y \
    17    openjdk-7-jdk \
    18    scala \
    19    curl
    20  
    21  curl -SsL -O http://dl.bintray.com/sbt/debian/sbt-0.13.5.deb && \
    22    dpkg -i sbt-0.13.5.deb
    23  
    24  curl -sSL "https://github.com/mesosphere/marathon/archive/v$MARATHON_VERSION.tar.gz" | tar -xzf - -C /opt
    25  ln -s "/opt/marathon-$MARATHON_VERSION" /app
    26  ln -s "/opt/marathon-$MARATHON_VERSION" /marathon
    27  
    28  cd /app
    29  
    30  # Word splitting wanted in this situation.
    31  # shellcheck disable=SC2046
    32  sbt assembly && \
    33    mv $(find target -name 'marathon-assembly-*.jar' | sort | tail -1) ./ && \
    34    rm -rf target/* ~/.sbt ~/.ivy2 && \
    35    mv marathon-assembly-*.jar target
    36  
    37  # cleanup. indicate that python, libpq and libyanl are required packages.
    38  apt-get clean -y && \
    39    rm -rf /tmp/* /var/tmp/* && \
    40    rm -rf /var/lib/apt/lists/*