[英]Jenkins builds with gradle subprojects
Is there anyway I can create a two module projects in gradle, and trigger a build for each module by itself? 无论如何,我可以在gradle中创建两个模块项目,并单独触发每个模块的构建吗?
Root project 'Example'
Jenkinsfile
\--- Project ':SubProject'
Jenkinsfile
I want that jenkins will trigger a build only in the module that has been changed. 我希望詹金斯只在已更改的模块中触发构建。
for example : 例如 :
If my SubProject
changed, then only SubProject
will execute it's own Jenkinsfile
. 如果我的
SubProject
更改了,那么只有SubProject
会执行它自己的Jenkinsfile
。
I looked up for this option for a very long time... 我很长一段时间都在寻找这个选项...
As you can see in the other questions, there is no any easy way to achieve that. 正如您在其他问题中看到的那样,没有任何简单的方法可以实现这一目标。
Is there any Jenkins pipeline
or plugin
that can deal with that? 是否有任何
Jenkins pipeline
或plugin
可以处理?
./gradlew :build
./gradlew :build
./gradlew :SubProject:build
./gradlew :SubProject:build
However, the triggering of one project only will most likely be the tricky thing as they most likely live in the same source control location. 但是,触发一个项目很可能是一件棘手的事情,因为它们很可能生活在同一源代码控制位置。
Maybe the easy fix is also to have them decoupled, using svn:externals
or Git submodules. 也许简单的解决方法是使用
svn:externals
或Git子模块将它们解耦。
Use excludedRegions
to exclude folders/files that would trigger a build. 使用
excludedRegions
排除将触发构建的文件夹/文件。
https://jenkins.io/doc/pipeline/steps/workflow-scm-step/ https://jenkins.io/doc/pipeline/steps/workflow-scm-step/
I'm unsure about the support of JenkinsFile... 我不确定JenkinsFile的支持...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.