How to create work with jenkins "private", which cannot be called directly, but only from another job?

Jenkins enables job binding - one job invokes another. We can configure it in the Trigger / call assembly in the other projects section.

Is it possible to create a Jenkins task "private", which can only be called from another task and never directly ?

It is assumed that users do not mistakenly run an internal task, which is referred to as one of the steps in the task chain. All users are trusted, this means error protection.

+4
source share
1 answer

/ . , 3 .

if (currentBuild.rawBuild.getCause(hudson.model.Cause$UpstreamCause) == null) {
    throw new SecurityException("can be only triggered from upstream")
}

, .

0

Source: https://habr.com/ru/post/1666727/


All Articles