Jenkins seed job that executes only DSL scripts modified since the last run? -
i have several source code repositories containing various bits of code built jenkins, one-to-one mapping between jenkins jobs , source repositories. separate these, have single repository containing job dsl scripts creating/updating jenkins jobs build other repos. situation looks this:
i had hoped find way store job dsl scripts inside individual source repositories, right alongside code, , have single seed job triggered push notifications any of other repositories. unfortunately, appears not supported (see accepted answer this question). given that, seems simplest leave dsls in single, separate repository, , let push notifications repository trigger reprocessing of groovy scripts. , works fine, more-or-less.
that said, i'm concerned seed job—when triggered—re-runs all of dsl scripts, rather have changed. (i'm not sure whether 'problem', per se, worry lead surprising behavior later on.)
is there way can restructure seed job re-runs scripts modified commit triggered build? or... not worth worrying about?
job dsl update job if generated config changes. compares generated xml existing config see if update necessary. see jenkinsjobmanagement.java. if not change jobs manually or run malicious plugins modify job's config in background, there should no problem when re-running scripts.
and job dsl reuses groovy script engine when running multiple scripts, performance impact should low. see dslscriptloader.groovy.
so if scripts have no side effects (e.g. making rest calls or modifying file system), should no problem re-run scripts if unnecessary.
Comments
Post a Comment