• Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • ws-cleanup-plugin
    • None

      Would be nice if it expanded build parameters using Util.replaceMacro() or EnvVars.expand()

          [JENKINS-30077] Expand build parameters

          Brantone added a comment -

          I've done this on a couple other plugins, I'll see if I can squeeze in the time to do it ... but shouldn't stop others from giving it a go.

          Brantone added a comment - I've done this on a couple other plugins, I'll see if I can squeeze in the time to do it ... but shouldn't stop others from giving it a go.

          vjuranek added a comment -

          Hi, what exactly you like to expand? Most of the options are check boxes... is it external delete command?

          vjuranek added a comment - Hi, what exactly you like to expand? Most of the options are check boxes... is it external delete command?

          Brantone added a comment - - edited

          In the current use, applies to a Publish step, so that "Patterns for files to be deleted" can take in a build parameter, ex: "${folder_to_delete}".
          Tried couple different ways and doesn't expand that to it's corresponding value using EnvVars.expand() , or even Util.replaceMacro() which would be useful for cases where the param can be set at some point in the build.

          I would imagine the optimal location would be:
          https://github.com/jenkinsci/ws-cleanup-plugin/blob/master/src/main/java/hudson/plugins/ws_cleanup/RemoteCleaner.java#L58

          Use the build var to expand/replace params on List<Pattern> patterns.

          Would that be optimal?

          Brantone added a comment - - edited In the current use, applies to a Publish step, so that "Patterns for files to be deleted" can take in a build parameter, ex: "${folder_to_delete}". Tried couple different ways and doesn't expand that to it's corresponding value using EnvVars.expand() , or even Util.replaceMacro() which would be useful for cases where the param can be set at some point in the build. I would imagine the optimal location would be: https://github.com/jenkinsci/ws-cleanup-plugin/blob/master/src/main/java/hudson/plugins/ws_cleanup/RemoteCleaner.java#L58 Use the build var to expand/replace params on List<Pattern> patterns. Would that be optimal?

          Mark Sanders added a comment -

          Mark Sanders added a comment - I too could use this. http://stackoverflow.com/questions/38795871/jenkins-clean-workspace-directory-with-paramater?noredirect=1#comment64973239_38795871

          Brantone added a comment -

          Brantone added a comment - Initial attempt at https://github.com/jenkinsci/ws-cleanup-plugin/pull/31 Thoughts?

          Mark added a comment -

          If I am understanding this issue correctly, does that mean this plugin currently NEVER expands things like the build number?  I see there is an open pull request with a help-wanted tag... what's the status there?

          Mark added a comment - If I am understanding this issue correctly, does that mean this plugin currently NEVER expands things like the build number?  I see there is an open pull request with a help-wanted tag... what's the status there?

            brantone Brantone
            brantone Brantone
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: