diff --git a/.ci/build-app-image.sh b/.ci/build-app-image.sh index 9c1b5880..12a31f1f 100755 --- a/.ci/build-app-image.sh +++ b/.ci/build-app-image.sh @@ -6,18 +6,29 @@ set -e # Exit immediately upon failure : ${3?"Need to pass TAG as argument"} : ${4?"Need to pass VERSION as argument"} +set +x + BASE_IMAGE=$1 TEST_APP=$2 TAG=$3 VERSION=$4 + echo "[CI] Injecting Dockerfile to project $TEST_APP..." 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 + +ls -al + +if [[ -f "Dockerfile" ]]; then + echo "Using existing Dockerfile in the sample." + echo "Dockerfile:" + cat Dockerfile +else + tee Dockerfile << EOF FROM $BASE_IMAGE COPY . /app WORKDIR /app @@ -26,6 +37,8 @@ ENV DNX_TRACE 1 ENTRYPOINT sleep 10000 | dnx . kestrel EOF +fi + echo "[CI] Building Docker image for $TEST_APP, will tag as '$TAG'..." docker build -t $TAG . echo "[CI] Built Docker image '$TAG'" diff --git a/.ci/find-tags.sh b/.ci/find-tags.sh index fdb43538..40d510e6 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 '1.0.0-beta[1-3]' | grep -v 'coreclr-1.0.0-beta5-11624' +find . -path ./.git -prune -o -name Dockerfile -print0 | xargs -0 -n1 dirname | sed -e "s/\.\///" | grep -v '1.0.0-beta[1-4]' | grep -v 'coreclr-1.0.0-beta5-11624' diff --git a/.ci/start-container.sh b/.ci/start-container.sh index 98f1aa74..6a98a4ca 100755 --- a/.ci/start-container.sh +++ b/.ci/start-container.sh @@ -20,4 +20,11 @@ docker run -t -d -p $HOST_PORT:$APP_PORT --name $CNT_NAME $APP_IMG # Wait to bootstrap the app echo "[CI] Sleeping $SLEEP seconds to bootstrap the server..." sleep $SLEEP -docker ps \ No newline at end of file + +echo "Docker logs:" +docker logs "$CNT_NAME" + +echo +echo "Docker ps:" +docker ps -a +