从 Jenkins 运行时找不到 Repo 命令

时间:2021-06-09 06:01:56

标签: linux bash shell jenkins repo

当我从 ubuntu 终端运行 repo init 时,它工作正常。

然后我创建了一个在同一台 ubuntu 机器上运行的自由式 Jenkins 作业。在执行 shell 块中,我添加了 #!/bin/bashrepo init

enter image description here

在执行 Jenkins Job 时,我面临以下错误

tmp/jenkins10026024406501021323.sh

/tmp/jenkins10026024406501021323.sh: line 2: repo: command not found

1 个答案:

答案 0 :(得分:1)

.bashrc 文件丢失,在创建 .bashrc 文件并在 export PATH=$HOME/.local/bin:$PATH 中添加 .bashrc 解决此错误后。