在jenkins上的构建作业期间更改目录 [英] Change directory during a build job on jenkins

查看:67
本文介绍了在jenkins上的构建作业期间更改目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建gradle项目,源代码在git中.在检查了我们对jenkins工作区的回购之后,我如何让jenkins进入子目录并进行构建?

I am building a gradle project and the source code is in git. After checking our repo to jenkins' workspace, how do i have jenkins go to a sub-directory and do the build?

我尝试添加shell命令,但是cd在单独的shell上执行脚本时无法正常工作.

I tried adding shell commands but cd will not work as it executes script on a separate shell.

推荐答案

如果要构建gradle项目,也许应该使用" Invoke gradle script "步骤而不是Shell脚本?

If you are building a gradle project, perhaps you should use the "Invoke gradle script" step rather than a shell script?

作为gradle构建脚本的一部分,它具有一个选项来指定" Root Build script "(根构建脚本),这将使您可以根据需要指定子目录.

As part of the gradle build script, it has an option to specify the "Root Build script", which will let allow you to specify a subdirectory if you wish.

有关详细信息,请参见 Gradle插件.

See the Gradle plugin for more information.

这篇关于在jenkins上的构建作业期间更改目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆