From ac05f792d0c88e835c4ed1c3201013c1df3be949 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 24 Mar 2021 22:10:16 +0100 Subject: [PATCH] Update code gen task to not rely on User in Dockerfile (#5468) --- .ci/make.sh | 10 +++++----- .github/workflows/make-codegen.yml | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.ci/make.sh b/.ci/make.sh index 839d74d6dbc..82cfeed8de7 100755 --- a/.ci/make.sh +++ b/.ci/make.sh @@ -14,11 +14,11 @@ TASK=$1 TASK_ARGS=() VERSION=$2 STACK_VERSION=$VERSION -REPO_BINDING="$repo:/sln" set -euo pipefail output_folder=".ci/output" OUTPUT_DIR="$repo/${output_folder}" +REPO_BINDING="${OUTPUT_DIR}:/sln/${output_folder}" mkdir -p "$OUTPUT_DIR" DOTNET_VERSION=${DOTNET_VERSION-5.0.103} @@ -49,19 +49,19 @@ case $CMD in TASK=codegen # VERSION is BRANCH here for now TASK_ARGS=("$VERSION") - REPO_BINDING="${OUTPUT_DIR}:/sln/${output_folder}" + REPO_BINDING="$repo:/sln" ;; *) echo -e "\nUsage:\n\t $CMD is not supported right now\n" exit 1 esac - #--volume "${OUTPUT_DIR}:/sln/${output_folder}" - +# -u does not work need to be root inside the container, the chown hack at the end ensures +# we still own any new files at the end of this run docker run \ --env "DOTNET_VERSION" \ --name test-runner \ --volume $REPO_BINDING \ --rm \ elastic/elasticsearch-net \ - ./build.sh $TASK "${TASK_ARGS[@]}" + /bin/bash -c "./build.sh $TASK ${TASK_ARGS[@]} && chown -R $(id -u):$(id -g) ." \ No newline at end of file diff --git a/.github/workflows/make-codegen.yml b/.github/workflows/make-codegen.yml index b1f1aaf65d9..5f378564d1e 100644 --- a/.github/workflows/make-codegen.yml +++ b/.github/workflows/make-codegen.yml @@ -38,6 +38,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} branch: "fix/${{ matrix.branch }}/code-gen" base: "${{ matrix.branch }}" + delete-branch: true commit-message: "[codegen] ${{ matrix.branch }} synchronization" title: '[codegen] ${{ matrix.branch }} synchronization' body: |