首页 > 解决方案 > 如何从 Jenkins 克隆到的 GitHub 目录运行命令?

问题描述

我按照此处的教程https://github.com/jbankes/Hello_Jenkins将“make”放入 Jenkins 的 Execute Shell 中,但 Jenkins 不会从底层 Github 存储库运行 make,如下面的错误消息所示。

要求 Jenkins 从其受监控的 GitHub 存储库运行“make”的正确方法是什么?

    Running as SYSTEM
Building in workspace /var/jenkins_home/workspace/test003
The recommended git tool is: NONE
No credentials specified
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://github.com/zhoulaifu/Hello_Jenkins # timeout=10
Fetching upstream changes from https://github.com/zhoulaifu/Hello_Jenkins
 > git --version # timeout=10
 > git --version # 'git version 2.20.1'
 > git fetch --tags --force --progress -- https://github.com/zhoulaifu/Hello_Jenkins +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
Checking out Revision bc3931a313e4f3945c257ae3247e63265b1debb7 (refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f bc3931a313e4f3945c257ae3247e63265b1debb7 # timeout=10
Commit message: "Otherside (#5)"
 > git rev-list --no-walk bc3931a313e4f3945c257ae3247e63265b1debb7 # timeout=10
[test003] $ /bin/sh -xe /tmp/jenkins2704537311990415428.sh
+ make
make: *** No targets specified and no makefile found.  Stop.
Build step 'Execute shell' marked build as failure
Finished: FAILURE

标签: jenkins

解决方案


在位于文件夹内的存储库 文件中。因此,为了能够运行,您需要导航到它。MakeoriginalMake

执行后再git clone运行。cd original/Make


推荐阅读