How can Jenkins build, differentiate between the invoked SCM and the user requested assembly?

I would like my assemblies to work differently (script processing is required) if the person requested the assembly through the Create Now button, or if it was called by SCM. I don’t want a checkbox in the user interface that users should change - I already received information about such things from them. The problem is that any parameter I set has the same default value, regardless of how the assembly starts.

+4
source share
2 answers

You should not have 1 job with different behavior. If you need other behavior, customize the work for the behavior. The best bet in your case is to have 2 separate tasks, one for assemblies built using SCM and one for manually built assemblies.

There is a plugin that allows you to filter tasks on separate pages (at the moment they cannot remember the name). You can install all SCM assemblies on 1 page, and manually on another, and then configure the manual assembly page as the standard entry. Users will only see jobs that you want to run manually by default, but you can still access the SCM assembly by selecting a different page.

+3
source

Could you somehow check the SCM polling log during the pre-build (using a script) and then from there?

0
source

All Articles