REPOST: Context.env() does not carry PATH variable in pipeline

12 views
Skip to first unread message

Nikhil Bhoski

unread,
Mar 8, 2020, 9:22:00 PM3/8/20
to Jenkins Developers

Hi ,

I have extended SimpleBuildWrapper Class which basically updated the PATH variable using

context.env("PATH+mytool",gePathOfTool()+ nodespecificFielspe + "bin")

This works fine when i run it through Freestyle project using jenkins UI . However when i run the same in pipeline sript the builder step does not find the PATH variable at all

PATH for both conext and build.getEnvironemnt(listener) shows null . any ideaon how can i get the PATH updated during build using my SimpleBuildWrapper ?

Regards
Nikhil

Gavin Mogan

unread,
Mar 8, 2020, 9:24:41 PM3/8/20
to jenkin...@googlegroups.com
Please stop reposting this same question

I would suggest since its not getting a response, its not something people know very well, and you may need to rethink how your doing it, or looking at other examples of plugins doing similar things.

Gavin

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/a77a0301-d4f2-4aa6-91ad-94765cbfda01%40googlegroups.com.

Nikhil Bhoski

unread,
Mar 9, 2020, 12:45:24 AM3/9/20
to Jenkins Developers
Thanks Gavin for response,
I have already checked few plugins like nodejs plugin which is doing same thing except for they are doing it through Tool configuration. My intention to repost is if i am missing  something then i would like to learn things. any reference that does the same thing what i am intending to . I also came across  @StepContextParameter which i think could be answered for my solution however i could not find enough documentation on this . my understanding was somebody from the core team would probably refer me to an appropriate learning substance. I feel its very normal scenario where someone want to set the PATH variable in SimpleBuildWrapper and would be able to access it during your build step which works for both Freestyle and pipeline projects. nay help on that would be appreciated.

apologies for REPOST. 

Regards
Nikhil

On Monday, 9 March 2020 06:54:41 UTC+5:30, Gavin Mogan wrote:
Please stop reposting this same question

I would suggest since its not getting a response, its not something people know very well, and you may need to rethink how your doing it, or looking at other examples of plugins doing similar things.

Gavin

On Sun, Mar 8, 2020 at 6:22 PM Nikhil Bhoski <nikhil...@gmail.com> wrote:

Hi ,

I have extended SimpleBuildWrapper Class which basically updated the PATH variable using

context.env("PATH+mytool",gePathOfTool()+ nodespecificFielspe + "bin")

This works fine when i run it through Freestyle project using jenkins UI . However when i run the same in pipeline sript the builder step does not find the PATH variable at all

PATH for both conext and build.getEnvironemnt(listener) shows null . any ideaon how can i get the PATH updated during build using my SimpleBuildWrapper ?

Regards
Nikhil

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkin...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages