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
15 changes: 14 additions & 1 deletion .ci/build-app-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recall a previous discussion where you mentioned about this script enabling dnx trace...currently the samples in home repo do not enable it (and they should not ideally)...is this a concern?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kichalla I mean if the kestrel prints the error, the CI collects the container logs as well... So that should be fine.

echo "Using existing Dockerfile in the sample."
echo "Dockerfile:"
cat Dockerfile
else
tee Dockerfile << EOF
FROM $BASE_IMAGE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: indent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was on purpose..

COPY . /app
WORKDIR /app
Expand All @@ -26,6 +37,8 @@ ENV DNX_TRACE 1
ENTRYPOINT sleep 10000 | dnx . kestrel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since all the samples(including older beta versions with their own respective dnx . kestrel) in the home repo have their own Dockerfile, I think the we can modify this line to be dnx kestrel instead as going forward this is going to be the way to run.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kichalla problem is, if you actually checkout to 1.0.0-beta4 tag for instance, they don't have dockerfiles: https://github.com/aspnet/Home/tree/v1.0.0-beta4/samples/1.0.0-beta4 yet we build them in the CI as well...

So keeping this should be making sense as it injects dockerfiles to old versions where it has to be "dnx . kestrel"...

Maybe it's time for us to retire all those old versions (beta1-2-3-4) today and get going with the newer ones. This could clarify and make the CI scripts a lot precise.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, got it.

EOF

fi

echo "[CI] Building Docker image for $TEST_APP, will tag as '$TAG'..."
docker build -t $TAG .
echo "[CI] Built Docker image '$TAG'"
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 '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'
9 changes: 8 additions & 1 deletion .ci/start-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

echo "Docker logs:"
docker logs "$CNT_NAME"

echo
echo "Docker ps:"
docker ps -a