Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-29144

SimpleBuildStep to receive EnvVars

    XMLWordPrintable

Details

    • Jenkins 2.241

    Description

      SimpleBuildStep.perform needs to be given an EnvVars argument. Otherwise there is no way for an implementation to observe any local environment variable settings.

      Attachments

        Issue Links

          Activity

            Technically this issue won't be solved until workflow-basic-steps is updated too.

            zastai Tim Van Holder added a comment - Technically this issue won't be solved until workflow-basic-steps is updated too.
            oleg_nenashev Oleg Nenashev added a comment -

            The Jenkins core patch was released in Jenkins 2.241

            oleg_nenashev Oleg Nenashev added a comment - The Jenkins core patch was released in Jenkins 2.241

            Add link to draft plugin PR.

            zastai Tim Van Holder added a comment - Add link to draft plugin PR.
            jglick Jesse Glick added a comment -

            The metastep system was not intended for use by domain-specific plugins, i.e. for anything other than core, wrap, and in the future perhaps checkout.

            jglick Jesse Glick added a comment - The metastep system was not intended for use by domain-specific plugins, i.e. for anything other than core , wrap , and in the future perhaps checkout .

            Turns out that for my immediate purpose in my plugin, it was actually very easy to add support for getting environment variables by implementing a metastep (all my builders share a base class that implements the perform() anyway, so no SimpleBuildStep needed at all).

            The trick is to know that metasteps exist, which I didn't until I read the javadoc for isMetaStep() while going over what CoreStep does.
             

            Anyway, I've assigned this to myself and will look at setting up clones of jenkins and workflow-basic-steps-plugin to see what I can make work without breaking tests.

            And thanks for the pointer to the incrementals; that's useful info.

            zastai Tim Van Holder added a comment - Turns out that for my immediate purpose in my plugin, it was actually very easy to add support for getting environment variables by implementing a metastep (all my builders share a base class that implements the perform() anyway, so no SimpleBuildStep needed at all). The trick is to know that metasteps exist, which I didn't until I read the javadoc for isMetaStep() while going over what CoreStep does.   Anyway, I've assigned this to myself and will look at setting up clones of jenkins and workflow-basic-steps-plugin to see what I can make work without breaking tests. And thanks for the pointer to the incrementals; that's useful info.

            People

              zastai Tim Van Holder
              jglick Jesse Glick
              Votes:
              3 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: