提交 9fca8e75 编写于 作者: B bors

Auto merge of #114206 - sethp:patch-1, r=Mark-Simulacrum

fix(ci): Ensure idempotence of user creation

Previously, re-running `run.sh` in the same container would fail at the useradd step, because the user already exists. Instead, change that step to "create if not exists" semantics to ease interactive debugging of CI failures.

Split out from https://github.com/rust-lang/rust/pull/111891 per request by `@jackh726`
......@@ -8,7 +8,7 @@ fi
if [ "$NO_CHANGE_USER" = "" ]; then
if [ "$LOCAL_USER_ID" != "" ]; then
useradd --shell /bin/bash -u $LOCAL_USER_ID -o -c "" -m user
id -u user &>/dev/null || useradd --shell /bin/bash -u $LOCAL_USER_ID -o -c "" -m user
export HOME=/home/user
unset LOCAL_USER_ID
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册