diff --git a/.ci/DockerFile b/.ci/DockerFile index 715212fa27b..4d5221c3705 100644 --- a/.ci/DockerFile +++ b/.ci/DockerFile @@ -13,7 +13,6 @@ RUN chown $GROUP_ID:$USER_ID $(pwd) COPY ./*.sln ./nuget.config ./*.Build.props ./*.Build.targets ./ COPY ./dotnet-tools.json ./ -RUN dotnet tool restore # todo standardize on Build.props as Directory.Build.props needs that form COPY ./src/*.Build.props ./src/ @@ -31,13 +30,12 @@ RUN for file in $(find . -name "*.?sproj"); do mkdir -p $(dirname $file)/$(basen COPY build/scripts/scripts.fsproj ./build/scripts/ COPY .ci/Jenkins.csproj ./.ci/ -RUN chown -R $GROUP_ID:$USER_ID $(pwd) +# Install app dependencies +RUN dotnet restore +RUN dotnet tool restore + RUN chown -R $GROUP_ID:$USER_ID $(pwd) RUN chown -R $GROUP_ID:$USER_ID /tmp/NuGetScratch -USER user - -# Install app dependencies -RUN dotnet restore # copy relevant files (see .dockerignore) COPY . . @@ -45,5 +43,8 @@ COPY . . # making sure enough git info is available inside the container RUN git rev-parse HEAD . +# USER user + + diff --git a/.ci/make.sh b/.ci/make.sh index 349a5dc36af..839d74d6dbc 100755 --- a/.ci/make.sh +++ b/.ci/make.sh @@ -14,6 +14,7 @@ TASK=$1 TASK_ARGS=() VERSION=$2 STACK_VERSION=$VERSION +REPO_BINDING="$repo:/sln" set -euo pipefail output_folder=".ci/output" @@ -48,6 +49,7 @@ case $CMD in TASK=codegen # VERSION is BRANCH here for now TASK_ARGS=("$VERSION") + REPO_BINDING="${OUTPUT_DIR}:/sln/${output_folder}" ;; *) echo -e "\nUsage:\n\t $CMD is not supported right now\n" @@ -59,7 +61,7 @@ esac docker run \ --env "DOTNET_VERSION" \ --name test-runner \ - --volume "$repo:/sln" \ + --volume $REPO_BINDING \ --rm \ elastic/elasticsearch-net \ ./build.sh $TASK "${TASK_ARGS[@]}"