Getting EnvVars in Pipeline Project Plugin

33 views
Skip to first unread message

Bibek Shrestha

unread,
Sep 19, 2016, 7:12:53 AM9/19/16
to Jenkins Developers
Hi,

The Notification Plugin (https://github.com/jenkinsci/notification-plugin) has not been updated to support the Pipeline plugins.
That is at the end `onCompleted(Run r, TaskListener listener)`, it should POST few EnvVars to a configurable URL.

The problem is `run.getEnvironment(listener)` does not contain values like GIT_URL, etc that should be set by the GitSCM plugin.


I read here that `Run` only contains the initial build environment. I did not understand the given solution here.

Can anyone guide me how I can access these values here?

Thanks,
Bibek Shrestha

Jesse Glick

unread,
Sep 19, 2016, 1:55:02 PM9/19/16
to Jenkins Dev
On Mon, Sep 19, 2016 at 4:12 AM, Bibek Shrestha <bibeks...@gmail.com> wrote:
> The Notification Plugin (https://github.com/jenkinsci/notification-plugin)
> has not been updated to support the Pipeline plugins.
> That is at the end `onCompleted(Run r, TaskListener listener)`, it should
> POST few EnvVars to a configurable URL.

Sounds like this should be reworked to be a `Notifier` which
additionally implements `SimpleBuildStep`.

Bibek Shrestha

unread,
Sep 20, 2016, 10:27:09 AM9/20/16
to Jenkins Developers
Hi Jesse,

Thanks for the answer.
Could you point me to some examples of plugins that are Notifier?

Many thanks

Jesse Glick

unread,
Sep 20, 2016, 12:37:13 PM9/20/16
to Jenkins Dev
On Tue, Sep 20, 2016 at 10:27 AM, Bibek Shrestha
<bibeks...@gmail.com> wrote:
> Could you point me to some examples of plugins that are Notifier?

https://wiki.jenkins-ci.org/display/JENKINS/Extension+points#Extensionpoints-hudson.tasks.Notifier

and click “Implementations”. Also see:

https://github.com/jenkinsci/pipeline-plugin/blob/master/COMPATIBILITY.md#build-steps-and-post-build-actions
Reply all
Reply to author
Forward
0 new messages