Skip to content

Commit e0891e9

Browse files
committed
Adapt build scripts to run with passwordless sudo podman
1 parent 251cea1 commit e0891e9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

build-release.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ publish_maven_library() {
115115
if [ $can_publish_maven == 0 ]; then
116116
return
117117
fi
118-
# FIXME: Might be worth reworking the script to make it all sudo-safe and use appropriate users throughout.
119-
sudo sh build-android/upload-mavencentral.sh
118+
sh build-android/upload-mavencentral.sh
120119
}
121120

122121
godot_version=""

build.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ mkdir -p ${basedir}/out
224224
mkdir -p ${basedir}/out/logs
225225
mkdir -p ${basedir}/mono-glue
226226

227-
export podman_run="${podman} run -it --rm --env BUILD_NAME --env GODOT_VERSION_STATUS --env NUM_CORES --env CLASSICAL=${build_classical} --env MONO=${build_mono} -v ${basedir}/godot-${godot_version}.tar.gz:/root/godot.tar.gz -v ${basedir}/mono-glue:/root/mono-glue -w /root/"
227+
export podman_run="${podman} run -it --rm --env BUILD_NAME=${BUILD_NAME} --env GODOT_VERSION_STATUS=${GODOT_VERSION_STATUS} --env NUM_CORES=${NUM_CORES} --env CLASSICAL=${build_classical} --env MONO=${build_mono} -v ${basedir}/godot-${godot_version}.tar.gz:/root/godot.tar.gz -v ${basedir}/mono-glue:/root/mono-glue -w /root/"
228228
export img_version=$IMAGE_VERSION
229229

230230
mkdir -p ${basedir}/mono-glue
@@ -248,6 +248,10 @@ ${podman_run} -v ${basedir}/build-android:/root/build -v ${basedir}/out/android:
248248
mkdir -p ${basedir}/out/ios
249249
${podman_run} -v ${basedir}/build-ios:/root/build -v ${basedir}/out/ios:/root/out localhost/godot-ios:${img_version} bash build/build.sh 2>&1 | tee ${basedir}/out/logs/ios
250250

251+
uid=$(id -un)
252+
gid=$(id -gn)
251253
if [ ! -z "$SUDO_UID" ]; then
252-
chown -R "${SUDO_UID}":"${SUDO_GID}" ${basedir}/git ${basedir}/out ${basedir}/mono-glue ${basedir}/godot*.tar.gz
254+
uid="${SUDO_UID}"
255+
gid="${SUDO_GID}"
253256
fi
257+
chown -R -f $uid:$gid ${basedir}/git ${basedir}/out ${basedir}/mono-glue ${basedir}/godot*.tar.gz

0 commit comments

Comments
 (0)