Skip to content
This repository was archived by the owner on May 31, 2019. It is now read-only.

React to changes kvm.sh for nightly an other versions #36

Merged
merged 1 commit into from
Feb 25, 2015
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
8 changes: 7 additions & 1 deletion .ci/build-app-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,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 TAG as argument"}
: ${4?"Need to pass BRANCH as argument"}

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

echo "[CI] Injecting Dockerfile to project $TEST_APP..."
cd $SAMPLES_REPO/samples/$TEST_APP
echo "[CI] Checkout branch $BRANCH"
git checkout $BRANCH
Copy link
Contributor

Choose a reason for hiding this comment

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

could you also add git checkout - after this command finishes? That could make sure we switch back to the old branch if we are done with this script successfully.

tee Dockerfile << EOF
FROM $BASE_IMAGE
COPY . /app
Expand All @@ -22,4 +26,6 @@ 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] 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/\.\///"
4 changes: 3 additions & 1 deletion .ci/run-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +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"}

BASE_IMAGE=$1
TEST_APP=$2
TEST_PORT=$RANDOM
BRANCH=$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
.ci/build-app-image.sh $BASE_IMAGE $TEST_APP $APP_IMG_TAG $BRANCH

# Start app
.ci/start-container.sh 5004 $TEST_PORT $APP_IMG_TAG $APP_IMG_TAG
Expand Down
4 changes: 3 additions & 1 deletion .ci/run-with-all-tags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ 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; fi
echo "[CI] ----------------------------------"
echo "[CI] Verifying '$2' app with '$TAG'"
.ci/run-app.sh $TAG $2
.ci/run-app.sh $TAG $2 $BRANCH
done

echo "[CI] '$2' runs fine on all tags."
2 changes: 1 addition & 1 deletion 1.0.0-beta1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ENV KRE_USER_HOME /opt/kre

RUN apt-get -qq update && apt-get -qqy install unzip

RUN curl -sSL https://raw.githubusercontent.com/aspnet/Home/v$KRE_VERSION/kvminstall.sh | sh
RUN curl -sSL https://raw.githubusercontent.com/aspnet/Home/release/kvminstall.sh | KVM_BRANCH=v$KRE_VERSION sh
RUN bash -c "source $KRE_USER_HOME/kvm/kvm.sh \
&& kvm install $KRE_VERSION -a default \
&& kvm alias default | xargs -i ln -s $KRE_USER_HOME/packages/{} $KRE_USER_HOME/packages/default"
Expand Down
2 changes: 1 addition & 1 deletion 1.0.0-beta2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ENV KRE_USER_HOME /opt/kre

RUN apt-get -qq update && apt-get -qqy install unzip

RUN curl -sSL https://raw.githubusercontent.com/aspnet/Home/v$KRE_VERSION/kvminstall.sh | sh
RUN curl -sSL https://raw.githubusercontent.com/aspnet/Home/release/kvminstall.sh | KVM_BRANCH=v$KRE_VERSION sh
RUN bash -c "source $KRE_USER_HOME/kvm/kvm.sh \
&& kvm install $KRE_VERSION -a default \
&& kvm alias default | xargs -i ln -s $KRE_USER_HOME/packages/{} $KRE_USER_HOME/packages/default"
Expand Down
13 changes: 8 additions & 5 deletions nightly/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM mono:3.12

ENV KRE_FEED https://www.myget.org/F/aspnetvnext/api/v2
ENV KRE_USER_HOME /opt/kre
ENV KVM_USER_HOME /opt/k

RUN apt-get -qq update && apt-get -qqy install unzip

ONBUILD RUN curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/kvminstall.sh | sh
ONBUILD RUN bash -c "source $KRE_USER_HOME/kvm/kvm.sh \
ONBUILD RUN curl -sSL https://raw.githubusercontent.com/aspnet/Home/release/kvminstall.sh | KRE_USER_HOME=$KVM_USER_HOME KVM_BRANCH=dev sh
ONBUILD RUN bash -c "source $KVM_USER_HOME/kvm/kvm.sh \
&& kvm install latest -a default \
&& kvm alias default | xargs -i ln -s $KRE_USER_HOME/packages/{} $KRE_USER_HOME/packages/default"
&& kvm alias default | xargs -i ln -s $KVM_USER_HOME/runtimes/{} $KVM_USER_HOME/runtimes/default"

# Install libuv for Kestrel from source code (binary is not in wheezy and one in jessie is still too old)
RUN apt-get -qqy install \
Expand All @@ -23,4 +23,7 @@ RUN LIBUV_VERSION=1.0.0-rc2 \
&& rm -rf /usr/local/src/libuv-$LIBUV_VERSION \
&& ldconfig

ENV PATH $PATH:$KRE_USER_HOME/packages/default/bin
COPY NuGet.Config /tmp/
RUN mkdir -p $HOME/.config/NuGet/ && mv /tmp/NuGet.Config $HOME/.config/NuGet/

ENV PATH $PATH:$KVM_USER_HOME/runtimes/default/bin
8 changes: 8 additions & 0 deletions nightly/NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetvnext/api/v2" />
<add key="NuGet.org" value="https://nuget.org/api/v2/" />
</packageSources>
</configuration>