-
Notifications
You must be signed in to change notification settings - Fork 847
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
104 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# | ||
# Base docker image used to build inside of a CI environment. | ||
# This should be updated and pushed with bin/update-base-build.sh | ||
# when we change the SBT version, mesos lib, or dependencies | ||
# | ||
# While it is not absolutely necessary (with the exception of the | ||
# mesos lib), it will significantly speedup the build. | ||
# | ||
# We install docker 1.11.0 to /usr/bin - it likely should be overridden by | ||
# the user's docker so that the versions match | ||
# | ||
# CI Builds should base their build off of this image which is tagged | ||
# carefully | ||
|
||
FROM java:8-jdk | ||
|
||
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E56151BF && \ | ||
echo "deb http://repos.mesosphere.com/debian jessie-testing main" | tee /etc/apt/sources.list.d/mesosphere.list && \ | ||
echo "deb http://repos.mesosphere.com/debian jessie main" | tee -a /etc/apt/sources.list.d/mesosphere.list && \ | ||
apt-get update && \ | ||
apt-get install --no-install-recommends -y --force-yes mesos=1.0.0-2.0.89.debian81 && \ | ||
curl -o /tmp/docker.tgz https://get.docker.com/builds/Linux/x86_64/docker-1.11.0.tgz && \ | ||
cd /tmp && \ | ||
tar zxf docker.tgz && \ | ||
mv docker/docker /usr/bin/docker && \ | ||
chmod +x /usr/bin/docker | ||
|
||
COPY . /marathon | ||
RUN rm -rf /marathon/project/project/target && \ | ||
rm -rf /marathon/project/target && \ | ||
eval $(sed s/sbt.version/SBT_VERSION/ < /marathon/project/build.properties) && \ | ||
mkdir -p /usr/local/bin && \ | ||
wget -P /usr/local/bin/ https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/$SBT_VERSION/sbt-launch.jar && \ | ||
cp /marathon/project/sbt /usr/local/bin && \ | ||
chmod +x /usr/local/bin/sbt | ||
|
||
RUN cd /marathon && \ | ||
sbt -Dsbt.log.format=false update && \ | ||
rm -rf /marathon/* | ||
|
||
WORKDIR /marathon | ||
|
||
ENTRYPOINT ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
cd $(dirname $0)/.. | ||
|
||
BASE_IMAGE_NAME=mesosphere/marathon-build-base | ||
BUILD_BASE_ID=$(md5sum Dockerfile.build *.sbt project/*.properties project/*.sbt project/*.scala | md5sum - | cut -f 1 -d ' ') | ||
TAGGED_IMAGE=$BASE_IMAGE_NAME:$BUILD_BASE_ID | ||
|
||
# Check if we need to build the base image | ||
if test "$(docker images -q $TAGGED_IMAGE 2>/dev/null)" = ""; then | ||
# try to pull, if that works, we're all set | ||
docker login -u "$DOCKER_HUB_USERNAME" -p "$DOCKER_HUB_PASSWORD" -e "$DOCKER_HUB_PASSWORD" >&2 || true | ||
|
||
if ! docker pull $TAGGED_IMAGE 1>&2; then | ||
docker build -t $TAGGED_IMAGE -f Dockerfile.build . >&2 | ||
docker push $TAGGED_IMAGE >&2 || true | ||
fi | ||
echo "Pulled $TAGGED_IMAGE" >&2 | ||
else | ||
echo "Already built $TAGGED_IMAGE" >&2 | ||
fi | ||
|
||
echo $TAGGED_IMAGE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 32 additions & 4 deletions
36
tests/integration/unit-integration-tests.sh
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,33 @@ | ||
#!/bin/bash | ||
set -v | ||
mkdir -p $HOME/.sbt/launchers/0.13.8/ | ||
test -r $HOME/.sbt/launchers/0.13.8/sbt-launch.jar || curl -L -o $HOME/.sbt/launchers/0.13.8/sbt-launch.jar http://dl.bintray.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.13.8/sbt-launch.jar | ||
java -Dfile.encoding=utf-8 -jar $HOME/.sbt/launchers/0.13.8/sbt-launch.jar -Dsbt.log.noformat=true "; clean; coverage; doc; assembly; coverageReport; coveralls" | ||
set -e | ||
|
||
if [[ -z $WORKSPACE ]]; then | ||
WORKSPACE=$(realpath $(dirname $0)/../..) | ||
mkdir -p $WORKSPACE/target-docker | ||
TARGET=$WORKSPACE/target-docker | ||
else | ||
TARGET=$WORKSPACE/target | ||
fi | ||
|
||
TAGGED_IMAGE=$($WORKSPACE/bin/build-base-image.sh) | ||
|
||
if [[ -z ${RUN_DOCKER_INTEGRATION_TESTS+x} ]]; then | ||
if [[ -z ${DOCKER_MACHINE_NAME+x} ]]; then | ||
RUN_DOCKER_INTEGRATION_TESTS="true" | ||
else | ||
RUN_DOCKER_INTEGRATION_TESTS="false" | ||
fi | ||
fi | ||
|
||
export MARATHON_MAX_TASKS_PER_OFFER="${MARATHON_MAX_TASKS_PER_OFFER-1}" | ||
|
||
|
||
DOCKER_OPTIONS="run --rm --name marathon-itests-$BUILD_ID --net host --privileged -e RUN_DOCKER_INTEGRATION_TESTS=$RUN_DOCKER_INTEGRATION_TESTS -e MARATHON_MAX_TASKS_PER_OFFER=$MARATHON_MAX_TASKS_PER_OFFER -v $WORKSPACE:/marathon -v $TARGET:/marathon/target -v /var/run/docker.sock:/var/run/docker.sock -v /etc/hosts:/etc/hosts -i" | ||
|
||
DOCKER_CMD="sbt -Dsbt.log.format=false coverage doc test integration:test coverageReport coveralls mesos-simulation/integration:test mesos-simulation/test:runMain mesosphere.mesos.scale.DisplayAppScalingResults" | ||
|
||
DOCKER_ARGS="$DOCKER_OPTIONS -c \"$DOCKER_CMD\"" | ||
|
||
echo "Running docker $DOCKER_ARGS" | ||
|
||
docker $DOCKER_ARGS |