diff --git a/.ci/DockerFile b/.ci/DockerFile index e09f0525222..715212fa27b 100644 --- a/.ci/DockerFile +++ b/.ci/DockerFile @@ -1,8 +1,15 @@ ARG DOTNET_VERSION=5.0.103 FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} AS elasticsearch-net-build -WORKDIR /sln +ARG USER_ID +ARG GROUP_ID + +RUN echo addgroup --gid $GROUP_ID user +RUN addgroup --gid $GROUP_ID user +RUN adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID user +WORKDIR /sln +RUN chown $GROUP_ID:$USER_ID $(pwd) COPY ./*.sln ./nuget.config ./*.Build.props ./*.Build.targets ./ COPY ./dotnet-tools.json ./ @@ -24,6 +31,11 @@ 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) +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 @@ -31,4 +43,7 @@ RUN dotnet restore COPY . . # making sure enough git info is available inside the container -RUN git rev-parse HEAD . \ No newline at end of file +RUN git rev-parse HEAD . + + + diff --git a/.ci/make.sh b/.ci/make.sh index 06ffe960ace..349a5dc36af 100755 --- a/.ci/make.sh +++ b/.ci/make.sh @@ -28,7 +28,9 @@ echo -e "\033[34;1mINFO:\033[0m DOTNET_VERSION ${DOTNET_VERSION}\033[0m" echo -e "\033[1m>>>>> Build [elastic/elasticsearch-net container] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" -docker build --file .ci/DockerFile --tag elastic/elasticsearch-net . +docker build --file .ci/DockerFile --tag elastic/elasticsearch-net \ + --build-arg USER_ID="$(id -u)" \ + --build-arg GROUP_ID="$(id -g)" . echo -e "\033[1m>>>>> Run [elastic/elasticsearch-net container] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" diff --git a/.ci/run-repository.sh b/.ci/run-repository.sh index d40465df8e9..146c8736eb2 100755 --- a/.ci/run-repository.sh +++ b/.ci/run-repository.sh @@ -37,7 +37,9 @@ echo -e "\033[34;1mINFO:\033[0m DOTNET_VERSION ${DOTNET_VERSION}\033[0m" echo -e "\033[1m>>>>> Build [elastic/elasticsearch-net container] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" -docker build --file .ci/DockerFile --tag elastic/elasticsearch-net . +docker build --file .ci/DockerFile --tag elastic/elasticsearch-net \ + --build-arg USER_ID=$(id -u) \ + --build-arg GROUP_ID=$(id -g) . echo -e "\033[1m>>>>> Run [elastic/elasticsearch-net container] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" diff --git a/.github/workflows/make-codegen.yml b/.github/workflows/make-codegen.yml index 0a0b3e36024..b1f1aaf65d9 100644 --- a/.github/workflows/make-codegen.yml +++ b/.github/workflows/make-codegen.yml @@ -33,7 +33,7 @@ jobs: name: "code-gen ${{ matrix.branch }}" - name: "PR ${{ matrix.branch }}" # fixate to known release. - uses: peter-evans/create-pull-request@5ea31358e901bfaf28ca19849903d802fd0a891b + uses: peter-evans/create-pull-request@052fc72b4198ba9fbc81b818c6e1859f747d49a8 with: token: ${{ secrets.GITHUB_TOKEN }} branch: "fix/${{ matrix.branch }}/code-gen" diff --git a/src/ApiGenerator/Configuration/GeneratorLocations.cs b/src/ApiGenerator/Configuration/GeneratorLocations.cs index 13ff28f9a6e..01a6d498eeb 100644 --- a/src/ApiGenerator/Configuration/GeneratorLocations.cs +++ b/src/ApiGenerator/Configuration/GeneratorLocations.cs @@ -11,7 +11,8 @@ public static class GeneratorLocations { // @formatter:off — disable formatter after this line public static string EsNetFolder { get; } = $@"{Root}../../src/Elasticsearch.Net/"; - public static string LastDownloadedRef { get; } = Path.Combine(Root, "last_downloaded_version.txt"); + + public static string LastDownloadedRef { get; } = Path.Combine(Path.GetTempPath(), "last_downloaded_version.txt"); public static string NestFolder { get; } = $@"{Root}../../src/Nest/"; public static string RestSpecificationFolder { get; } = $@"{Root}RestSpecification/"; diff --git a/src/ApiGenerator/last_downloaded_version.txt b/src/ApiGenerator/last_downloaded_version.txt deleted file mode 100644 index e5385a6ab9e..00000000000 --- a/src/ApiGenerator/last_downloaded_version.txt +++ /dev/null @@ -1 +0,0 @@ -47b8ea53cca02c74a34f4dcea0fb1274ee29b9d4 \ No newline at end of file