diff --git a/.ci/build-app-image.sh b/.ci/build-app-image.sh index 2bc784bc..9c1b5880 100755 --- a/.ci/build-app-image.sh +++ b/.ci/build-app-image.sh @@ -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 diff --git a/.ci/find-tags.sh b/.ci/find-tags.sh index 304eff73..fdb43538 100755 --- a/.ci/find-tags.sh +++ b/.ci/find-tags.sh @@ -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' diff --git a/.ci/run-app.sh b/.ci/run-app.sh index 2d104441..e8937ab6 100755 --- a/.ci/run-app.sh +++ b/.ci/run-app.sh @@ -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 diff --git a/.ci/run-with-all-tags.sh b/.ci/run-with-all-tags.sh index e4503731..d51ea536 100755 --- a/.ci/run-with-all-tags.sh +++ b/.ci/run-with-all-tags.sh @@ -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." \ No newline at end of file diff --git a/circle.yml b/circle.yml index 03f177cd..7efab2d5 100644 --- a/circle.yml +++ b/circle.yml @@ -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: