Skip to content
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
2 changes: 1 addition & 1 deletion bindings/java/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ cat > $build_json <<EOC
}
EOC

docker container run --rm -v $self_dir:/local "${swagger_codegen_cli_image:?}" generate \
docker container run --rm --user "${codegen_run_user:?}" -v $self_dir:/local "${swagger_codegen_cli_image:?}" generate \
--type-mappings Integer=java.math.BigInteger \
-c /local/src/build.json \
-i $openapi_url \
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cat > $build_json <<EOC
}
EOC

docker container run --rm -v $self_dir:/local "${swagger_codegen_cli_image:?}" generate \
docker container run --rm --user "${codegen_run_user:?}" -v $self_dir:/local "${swagger_codegen_cli_image:?}" generate \
-c /local/src/build.json \
-i $openapi_url \
-l python \
Expand Down
2 changes: 1 addition & 1 deletion bindings/ruby/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cat > $build_json <<EOC
}
EOC

docker container run --rm -v $self_dir:/local "${swagger_codegen_cli_image:?}" generate \
docker container run --rm --user "${codegen_run_user:?}" -v $self_dir:/local "${swagger_codegen_cli_image:?}" generate \
-c /local/src/build.json \
-i $openapi_url \
-l ruby \
Expand Down
6 changes: 3 additions & 3 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ build_language() {
$root_dir/bindings/$language/build.sh
}

test -z "$language" && {
if test -z "$language"; then
for I in $root_dir/bindings/*; do
build_language $(basename $I)
done
} || {
else
Comment on lines +39 to +43
build_language $language
}
fi

echo "Applying ruff autofixes to generated sources ..."
uvx ruff check --fix "$root_dir"
6 changes: 6 additions & 0 deletions scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ summary="Cloudsmith API"

common_codegen_options="--git-user-id $git_user_id --git-repo-id $git_repo_id"

# Codegen writes into a bind-mounted directory. On Linux the container's root
# user owns the result, which blocks the post-generation fixups (Ruby
# re-escaping, ruff autofixes) from rewriting those files, so run as the
# invoking user instead.
codegen_run_user="$(id -u):$(id -g)"

function die {
echo "$@"
exit 1
Expand Down