Skip to content

Commit b67defd

Browse files
[Backport 7.x] move dotnet tool restore down after setting usr (#5465)
Co-authored-by: Martijn Laarman <Mpdreamz@gmail.com>
1 parent 83b0bed commit b67defd

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

.ci/DockerFile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ RUN chown $GROUP_ID:$USER_ID $(pwd)
1313
COPY ./*.sln ./nuget.config ./*.Build.props ./*.Build.targets ./
1414

1515
COPY ./dotnet-tools.json ./
16-
RUN dotnet tool restore
1716

1817
# todo standardize on Build.props as Directory.Build.props needs that form
1918
COPY ./src/*.Build.props ./src/
@@ -31,19 +30,21 @@ RUN for file in $(find . -name "*.?sproj"); do mkdir -p $(dirname $file)/$(basen
3130
COPY build/scripts/scripts.fsproj ./build/scripts/
3231
COPY .ci/Jenkins.csproj ./.ci/
3332

34-
RUN chown -R $GROUP_ID:$USER_ID $(pwd)
33+
# Install app dependencies
34+
RUN dotnet restore
35+
RUN dotnet tool restore
36+
3537
RUN chown -R $GROUP_ID:$USER_ID $(pwd)
3638
RUN chown -R $GROUP_ID:$USER_ID /tmp/NuGetScratch
37-
USER user
38-
39-
# Install app dependencies
40-
RUN dotnet restore
4139

4240
# copy relevant files (see .dockerignore)
4341
COPY . .
4442

4543
# making sure enough git info is available inside the container
4644
RUN git rev-parse HEAD .
4745

46+
# USER user
47+
48+
4849

4950

.ci/make.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ TASK=$1
1414
TASK_ARGS=()
1515
VERSION=$2
1616
STACK_VERSION=$VERSION
17+
REPO_BINDING="$repo:/sln"
1718
set -euo pipefail
1819

1920
output_folder=".ci/output"
@@ -48,6 +49,7 @@ case $CMD in
4849
TASK=codegen
4950
# VERSION is BRANCH here for now
5051
TASK_ARGS=("$VERSION")
52+
REPO_BINDING="${OUTPUT_DIR}:/sln/${output_folder}"
5153
;;
5254
*)
5355
echo -e "\nUsage:\n\t $CMD is not supported right now\n"
@@ -59,7 +61,7 @@ esac
5961
docker run \
6062
--env "DOTNET_VERSION" \
6163
--name test-runner \
62-
--volume "$repo:/sln" \
64+
--volume $REPO_BINDING \
6365
--rm \
6466
elastic/elasticsearch-net \
6567
./build.sh $TASK "${TASK_ARGS[@]}"

0 commit comments

Comments
 (0)