Skip to content

[Backport 7.12] move dotnet tool restore down after setting usr #5464

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2021
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
13 changes: 7 additions & 6 deletions .ci/DockerFile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -31,19 +30,21 @@ 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 . .

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

# USER user




4 changes: 3 additions & 1 deletion .ci/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ TASK=$1
TASK_ARGS=()
VERSION=$2
STACK_VERSION=$VERSION
REPO_BINDING="$repo:/sln"
set -euo pipefail

output_folder=".ci/output"
Expand Down Expand Up @@ -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"
Expand All @@ -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[@]}"