Azure DevOps vsts-agent-linux 安装出错, Must not run with sudo
在linux安装 vsts-agent-linux
在vsts-agent-linux的解压目录运行./config.sh, 提示"Must not run with sudo",
需要在./config.sh中
if [ $user_id -eq 0 -a -z "$AGENT_ALLOW_RUNASROOT" ]; then
echo "Must not run with sudo"
exit 1
fi
改成
if [ $user_id -eq 0 -a -z "$AGENT_ALLOW_RUNASROOT" ] && [ "${ALLOW_RUNASROOT:-default_value}" == "default_value" ]; then
echo "Must not run with sudo"
exit 1
fi
即可
然后按照提示安装即可
./bin/installdependencies.sh to install
中间可能会卡很久, Ctrl+C停止, 重来一遍即可
完成后, 运行./run.sh即可, ./run.sh也要修改, 同./config.sh
正常情况下, Azure DevOps 的代理就能看到了
之后启动, 运行./runsvc.sh就好了
这个是Must not run with sudo错误的处理链接
https://github.com/microsoft/azure-pipelines-agent/pull/1713/commits/15a5beea684fa35172d661f3253b93e210409fbb
这是微软的部署代理的链接
https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-linux?view=azure-devops