Skip to content

Commit 9a04224

Browse files
[Backport 7.12] Update code gen task to not rely on User in Dockerfile (#5471)
Co-authored-by: Martijn Laarman <Mpdreamz@gmail.com>
1 parent 2f1f003 commit 9a04224

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.ci/make.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ TASK=$1
1414
TASK_ARGS=()
1515
VERSION=$2
1616
STACK_VERSION=$VERSION
17-
REPO_BINDING="$repo:/sln"
1817
set -euo pipefail
1918

2019
output_folder=".ci/output"
2120
OUTPUT_DIR="$repo/${output_folder}"
21+
REPO_BINDING="${OUTPUT_DIR}:/sln/${output_folder}"
2222
mkdir -p "$OUTPUT_DIR"
2323

2424
DOTNET_VERSION=${DOTNET_VERSION-5.0.103}
@@ -49,19 +49,19 @@ case $CMD in
4949
TASK=codegen
5050
# VERSION is BRANCH here for now
5151
TASK_ARGS=("$VERSION")
52-
REPO_BINDING="${OUTPUT_DIR}:/sln/${output_folder}"
52+
REPO_BINDING="$repo:/sln"
5353
;;
5454
*)
5555
echo -e "\nUsage:\n\t $CMD is not supported right now\n"
5656
exit 1
5757
esac
5858

59-
#--volume "${OUTPUT_DIR}:/sln/${output_folder}"
60-
59+
# -u does not work need to be root inside the container, the chown hack at the end ensures
60+
# we still own any new files at the end of this run
6161
docker run \
6262
--env "DOTNET_VERSION" \
6363
--name test-runner \
6464
--volume $REPO_BINDING \
6565
--rm \
6666
elastic/elasticsearch-net \
67-
./build.sh $TASK "${TASK_ARGS[@]}"
67+
/bin/bash -c "./build.sh $TASK ${TASK_ARGS[@]} && chown -R $(id -u):$(id -g) ."

.github/workflows/make-codegen.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
token: ${{ secrets.GITHUB_TOKEN }}
3939
branch: "fix/${{ matrix.branch }}/code-gen"
4040
base: "${{ matrix.branch }}"
41+
delete-branch: true
4142
commit-message: "[codegen] ${{ matrix.branch }} synchronization"
4243
title: '[codegen] ${{ matrix.branch }} synchronization'
4344
body: |

0 commit comments

Comments
 (0)