It would be useful to be able to supply defined configuration files to workflows.

      Possibly it would suffice to make ConfigFileBuildStep be a SimpleBuildStep. CleanTempFilesRunListener cannot be made to work on a flow build (even if you accept any Run there is no guarantee the slave is still online at the end of the flow), so if cleaning files is important then this would better be a block-scoped custom Step.

      Not sure what ConfigFileBuildWrapper is for as distinct from the build step, but probably it would be covered better by a block-scoped step.

          [JENKINS-26339] Workflow integration for Config File Provider

          Jesse Glick created issue -

          Code changed in jenkins
          User: Jesse Glick
          Path:
          COMPATIBILITY.md
          http://jenkins-ci.org/commit/workflow-plugin/264acdc527d2360105cd47ef94bf3b90afcdee2b
          Log:
          JENKINS-26339 Noting.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: COMPATIBILITY.md http://jenkins-ci.org/commit/workflow-plugin/264acdc527d2360105cd47ef94bf3b90afcdee2b Log: JENKINS-26339 Noting.

          There is already a PR for it: https://github.com/jenkinsci/config-file-provider-plugin/pull/8

          ...I just did not take care of it yet, I'll try to do it soon!

          Many people see providing of configuration files as a environment preparation, therefore ConfigFileBuildWrapper

          Dominik Bartholdi added a comment - There is already a PR for it: https://github.com/jenkinsci/config-file-provider-plugin/pull/8 ...I just did not take care of it yet, I'll try to do it soon! Many people see providing of configuration files as a environment preparation, therefore ConfigFileBuildWrapper

          Stefan Lorenz added a comment -

          Hi, that's my pull request.
          It seems that it's not working correct, because the plugin is using TokenMacro and the constructor wants AbstractBuild.
          I have no idea how to get AbstractBuild from Run which SimpleBuildStep provides...

          Perhaps you can give me a hint...

          Stefan Lorenz added a comment - Hi, that's my pull request. It seems that it's not working correct, because the plugin is using TokenMacro and the constructor wants AbstractBuild. I have no idea how to get AbstractBuild from Run which SimpleBuildStep provides... Perhaps you can give me a hint...

          Jesse Glick added a comment -

          As noted earlier, CleanTempFilesRunListener will not work as is. Assuming this is important, the current PR cannot work (even if token-macro were updated) and so the options are

          1. Make a custom block-scoped Step rather than using SimpleBuildStep.
          2. Wait for JENKINS-24673 to be implemented, probably requiring a new core dependency, and then upgrade ConfigFileBuildWrapper.

          Jesse Glick added a comment - As noted earlier, CleanTempFilesRunListener will not work as is. Assuming this is important, the current PR cannot work (even if token-macro were updated) and so the options are Make a custom block-scoped Step rather than using SimpleBuildStep . Wait for JENKINS-24673 to be implemented, probably requiring a new core dependency, and then upgrade ConfigFileBuildWrapper .
          Jesse Glick made changes -
          Link New: This issue depends on JENKINS-24673 [ JENKINS-24673 ]
          Jesse Glick made changes -
          Summary Original: Workflow integration New: Workflow integration for Config File Provider
          Jesse Glick made changes -
          Remote Link New: This issue links to "PR 9 (Web Link)" [ 12022 ]

          Jesse Glick added a comment -

          I have implemented the second option. I just realized there is a third: offer the SimpleBuildStep, but issue an error in case the build is not an AbstractBuild and one or more ManagedFile lacks a targetLocation (thus forcing use of temp files). In this case the workflow would be responsible for cleanup:

          node {
            try {
              step([$class: 'ConfigFileBuildStep', managedFiles: [[fileId: 'DefaultMavenSettingsProvider.production', targetLocation: 'settings-prod.xml']]]) {
                sh 'mvn -s settings-prod.xml deploy'
              }
            } finally {
              sh 'rm -f settings-prod.xml'
            }
          }
          

          Not very attractive though.

          Jesse Glick added a comment - I have implemented the second option. I just realized there is a third: offer the SimpleBuildStep , but issue an error in case the build is not an AbstractBuild and one or more ManagedFile lacks a targetLocation (thus forcing use of temp files). In this case the workflow would be responsible for cleanup: node { try { step([$class: 'ConfigFileBuildStep' , managedFiles: [[fileId: 'DefaultMavenSettingsProvider.production' , targetLocation: 'settings-prod.xml' ]]]) { sh 'mvn -s settings-prod.xml deploy' } } finally { sh 'rm -f settings-prod.xml' } } Not very attractive though.
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

            domi Dominik Bartholdi
            jglick Jesse Glick
            Votes:
            5 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: