Jenkins - conditions between build steps

前端 未结 1 366
暖寄归人
暖寄归人 2021-01-13 23:26

I want to build a Maven project using Jenkins. However, the project only must be built if a certain file in the SVN repository has changed (and contains a special key)

相关标签:
1条回答
  • 2021-01-14 00:01

    We do something similar with our own Jenkins setup.

    We have a "trigger" job that monitors SVN on a periodic basis. When a change occurs in SVN, the trigger job executes its build steps. One of the build steps examines some aspects of the code and decides whether a build is necessary or not. If it is necessary, it uses CURL to initiate the start of a the "build" project. The "build" project gets the source code and does a build - it doesn't bother to figure out whether it needs to build or not - it always does.

    Having the two tasks separate also makes it easy to trigger a manual build without worrying the should-I-build logic kicking and stopping the build.

    0 讨论(0)
提交回复
热议问题