Skip to content
This repository was archived by the owner on May 31, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .ci/build-app-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@ set -e # Exit immediately upon failure
: ${1?"Need to pass BASE_IMAGE as argument"}
: ${2?"Need to pass TEST_APP as argument"}
: ${3?"Need to pass TAG as argument"}
: ${4?"Need to pass BRANCH as argument"}
: ${4?"Need to pass VERSION as argument"}

BASE_IMAGE=$1
TEST_APP=$2
TAG=$3
BRANCH=$4
VERSION=$4

echo "[CI] Injecting Dockerfile to project $TEST_APP..."
cd $SAMPLES_REPO/samples/$TEST_APP
echo "[CI] Checkout branch $BRANCH"
git checkout $BRANCH
if [[ ! -d $SAMPLES_REPO/samples/$VERSION/$TEST_APP ]]; then
echo "[CI] Sample '$TEST_APP' not found for Docker image '$VERSION'"
exit 1
fi
cd $SAMPLES_REPO/samples/$VERSION/$TEST_APP
tee Dockerfile << EOF
FROM $BASE_IMAGE
COPY . /app
WORKDIR /app
RUN kpm restore
ENV KRE_TRACE 1
ENTRYPOINT sleep 10000 | k kestrel
RUN dnu restore
ENV DNX_TRACE 1
ENTRYPOINT sleep 10000 | dnx . kestrel
EOF

echo "[CI] Building Docker image for $TEST_APP, will tag as '$TAG'..."
docker build -t $TAG .
echo "[CI] Built Docker image '$TAG'"
echo "[CI] Revert checkout"
git checkout master
2 changes: 1 addition & 1 deletion .ci/find-tags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ set -o pipefail # carry failures over pipes
: ${1?"Need to pass Dockerfile search directory as argument"}

cd $1
find . -path ./.git -prune -o -name Dockerfile -print0 | xargs -0 -n1 dirname | sed -e "s/\.\///" | grep -v nightly
find . -path ./.git -prune -o -name Dockerfile -print0 | xargs -0 -n1 dirname | sed -e "s/\.\///" | grep -v '1.0.0-beta[1-3]' | grep -v 'coreclr-1.0.0-beta5-11624'
6 changes: 3 additions & 3 deletions .ci/run-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ set -e # Exit immediately upon failure

: ${1?"Need to pass BASE_IMAGE as argument"}
: ${2?"Need to pass TEST_APP as argument"}
: ${3?"Need to pass BRANCH as argument"}
: ${3?"Need to pass VERSION as argument"}

BASE_IMAGE=$1
TEST_APP=$2
TEST_PORT=$RANDOM
BRANCH=$3
VERSION=$3

APP_IMG_TAG=$(tr '[:upper:]' '[:lower:]' <<< $TEST_APP)_${TEST_PORT}

# Build the app image
.ci/build-app-image.sh $BASE_IMAGE $TEST_APP $APP_IMG_TAG $BRANCH
.ci/build-app-image.sh $BASE_IMAGE $TEST_APP $APP_IMG_TAG $VERSION

# Start app
.ci/start-container.sh 5004 $TEST_PORT $APP_IMG_TAG $APP_IMG_TAG
Expand Down
4 changes: 1 addition & 3 deletions .ci/run-with-all-tags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ set -e # Exit immediately upon failure

for tag in `.ci/find-tags.sh $1`; do
TAG=${IMAGE}:${tag}
BRANCH=master
if [[ ${tag} == "nightly" ]]; then BRANCH=dev; else BRANCH=tags/v${tag} ; fi
echo "[CI] ----------------------------------"
echo "[CI] Verifying '$2' app with '$TAG'"
.ci/run-app.sh $TAG $2 $BRANCH
.ci/run-app.sh $TAG $2 ${tag}
done

echo "[CI] '$2' runs fine on all tags."
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ general:

checkout:
post:
- git clone -q git://github.com/aspnet/Home.git $SAMPLES_REPO
- git clone -q git://github.com/aspnet/Home.git -b dev $SAMPLES_REPO

dependencies:
override:
Expand Down