From fb4aa2cc0212d0f26785d716f6748f1572edf566 Mon Sep 17 00:00:00 2001 From: Vincent Lesierse Date: Sun, 22 Feb 2015 22:48:41 +0100 Subject: [PATCH] React to changes kvm.sh for nightly an other versions - Use KVM_USER_HOME instead of KRE_USER_HOME - Change folder from packaged to runtimes --- .ci/build-app-image.sh | 8 +++++++- .ci/find-tags.sh | 2 +- .ci/run-app.sh | 4 +++- .ci/run-with-all-tags.sh | 4 +++- 1.0.0-beta1/Dockerfile | 2 +- 1.0.0-beta2/Dockerfile | 2 +- nightly/Dockerfile | 13 ++++++++----- nightly/NuGet.Config | 8 ++++++++ 8 files changed, 32 insertions(+), 11 deletions(-) create mode 100644 nightly/NuGet.Config diff --git a/.ci/build-app-image.sh b/.ci/build-app-image.sh index e6fa32f4..2bc784bc 100755 --- a/.ci/build-app-image.sh +++ b/.ci/build-app-image.sh @@ -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 tee Dockerfile << EOF FROM $BASE_IMAGE COPY . /app @@ -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'" \ No newline at end of file +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..ef781ec6 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/\.\///" diff --git a/.ci/run-app.sh b/.ci/run-app.sh index 49406dcb..2d104441 100755 --- a/.ci/run-app.sh +++ b/.ci/run-app.sh @@ -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 diff --git a/.ci/run-with-all-tags.sh b/.ci/run-with-all-tags.sh index 56eeab9a..42bc970f 100755 --- a/.ci/run-with-all-tags.sh +++ b/.ci/run-with-all-tags.sh @@ -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." \ No newline at end of file diff --git a/1.0.0-beta1/Dockerfile b/1.0.0-beta1/Dockerfile index e73c8253..d2ceb20a 100644 --- a/1.0.0-beta1/Dockerfile +++ b/1.0.0-beta1/Dockerfile @@ -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" diff --git a/1.0.0-beta2/Dockerfile b/1.0.0-beta2/Dockerfile index ff53545c..24bf17df 100644 --- a/1.0.0-beta2/Dockerfile +++ b/1.0.0-beta2/Dockerfile @@ -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" diff --git a/nightly/Dockerfile b/nightly/Dockerfile index 772aaa3c..8c2384ea 100644 --- a/nightly/Dockerfile +++ b/nightly/Dockerfile @@ -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 \ @@ -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 diff --git a/nightly/NuGet.Config b/nightly/NuGet.Config new file mode 100644 index 00000000..acffb7a6 --- /dev/null +++ b/nightly/NuGet.Config @@ -0,0 +1,8 @@ + + + + + + + +