Plugin Information |
---|
View Config File Provider on the plugin site for more information. |
Older versions of this plugin may not be safe to use. Please review the following warnings before using an older version:
- XSS vulnerability
- XXE vulnerability
- Incorrect permission checks allow enumerating credentials IDs
- Cross-site request forgery vulnerability
- Users with Overall/Read access could access configuration files
- CSRF vulnerability allows deleting configuration files
- Missing permission checks allow enumerating configuration file IDs
- Cross Site Scripting vulnerability
- How it works
- Using the configuration files in Jenkins Pipelines
- Plugins adding support for new file types
- Extension Point
- Help and Support
- Known issues
- History
- Version 3.6.2 (18. June 2019)
- Version 3.6.1 (5. June 2019)
- Version 3.6 (22. Mar. 2019)
- Version 3.5 (28. Jan. 2019)
- Version 3.4.1 (1. Nov. 2018)
- Version 3.3 (11. Oct. 2018)
- Version 3.2 (25. Sept. 2018)
- Version 3.0 (3. Sept. 2018)
- Version 2.18 (12. Mar. 2018)
- Version 2.17 (17. Jan. 2018)
- Version 2.16.4 (22. Sept. 2017)
- Version 2.16.3 (14. August 2017)
- Version 2.16.2 (7. August 2017)
- Version 2.16.1 (26. July 2017)
- Version 2.16.0 (22. May 2017)
- Version 2.15.7 (17. March 2017)
- Version 2.15.6 (13. Feb. 2017)
- Version 2.15.5 (19. Jan. 2017)
- Version 2.15.4 (13. Jan. 2017)
- Version 2.15.3 (06. Jan. 2016)
- Version 2.15.1 (27. Dec. 2016) DO NOT INSTALL!!
- Version 2.15 (27. Dec. 2016) DO NOT INSTALL!!
- Version 2.13 (9. Sep. 2016)
- Version 2.11 (24. June 2016)
- Version 2.10.1 (29. March 2015)
- Version 2.10.0 (7. Dec 2015)
- Version 2.9.3 (20. Aug 2015)
- Version 2.9.2 (4. Aug 2015)
- Version 2.8.1 (11. May 2015)
- Version 2.7.5 (8. Aug 2014)
- Version 2.7.4 (30.March 2014)
- Version 2.7.1 (4.Nov. 2013)
- Version 2.7 (3. Nov. 2013)
- Version 2.6.2 (17. Sep. 2013)
- Version 2.6.1 (1. Aug. 2013)
- Version 2.6 (23. July 2013)
- Version 2.5.1 (2. June 2013)
- Version 2.5 (15. March 2013)
- Version 2.4 (12. Dez 2012)
- Version 2.3 (19. Nov 2012)
- Version 2.2.1 (27. April 2012)
- Version 2.1 (16. April 2012)
- Version 2.0 (3. April 2012)
- Version 1.2 (8. Nov. 2011)
- Version 1.1 (29th August 2011)
- Version 1.0 (16th August 2011)
How it works
It will allow you to copy various similar configuration files to all your nodes. It also adds the ability to edit those files through the Jenkins UI.
File Types
In general, you can manage whatever file format you like with this plugin (except binary), but the UI provides some advanced editing support for the following file types:
- Maven settings.xml (user and global)
- plain XML
- Groovy
- JSON
- Custom (plain text)
Load your configuration file content.
Choose the "Managed files" in the administration home:
Edit an existing file or add a new file:
Choose the configuration type:
Edit the content:
Configure the Maven plugin to use it:
Provide any config file to a project
Maven Server Credentials (since 2.7)
The file types 'Global Maven settings.xml' and 'Maven settings.xml' have built-in support for the Credentials Plugin. When the plugin serves the settings.xml to the maven execution, the credentials get injected. This functionality is only available in the maven builder (e.g. for freestyle projects) and maven project type.
After installation of the Config File Provider Plugin, a new Credentials Specification is available and can be used to mark credentials domain to contain credentials valid for maven server ids. The "Maven serverId" Specification allows you to define serverId patterns - this will make it easier to select the correct credential when configuring the settings.xml.
The current implementation supports "Username with password"-credentials. If your passwords are encrypted by maven, you can store the encrypted passwords in the same configuration - but you have to make sure the settings-security.xml is available to the job, unfortunately maven does not yet provide a way to pass this file aswell, so this file has to be located at the original location required by maven (<user.home>/.m2)
When configuring the settings.xml (user or global), you can add as many credential mappings as you wish, as soon as you add at least one serverId-credentials mapping to a config file all server configs in the same file will be removed and replaced by the ones you have explicitly added - this way you are sure which credentials finally end up in the file used by the jobs.
This example will add two server configurations to your settings.xml, one called 'artifactory.prod' (using 'release_user' with password) and the other 'artifactory.dev' (using 'snapshot_user' with password).
Now provided settings.xml with credentials can be used in the project and builder configuration. A common practice would be to define a global settings.xml to provide credentials and repository definitions and have local (default) settings.xml define the location of the local repo.
Using the configuration files in Jenkins Pipelines
The configuration files can be used in Jenkins pipeline.
The configuration file can either be stored in a desired file path or can be stored in a temporary file identified by the given "variable
".
Sample for a Maven build:
node { git url: 'https://github.com/spring-projects/spring-petclinic.git' // install Maven and add it to the path env.PATH = "${tool 'M3'}/bin:${env.PATH}" configFileProvider( [configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) { sh 'mvn -s $MAVEN_SETTINGS clean package' } }
The "Pipeline Syntax" page helps to write the proper syntax. (before version 2.13, the build wrapper syntax "wrap([$class: 'ConfigFileBuildWrapper'...]{...
}" hat to be used)
Plugins adding support for new file types
-
Managed Script Plugin — Managed scripts are shell scripts which are managed centrally by an administrator and can be referenced as a build step within jobs.
Extension Point
This plugin makes use of the org.jenkinsci.lib.configprovider.ConfigProvider ExtensionPoint. If you need to have easy administration of a new file type, just implement this ExtensionPoint and you're ready to go.
The easiest way to do so is to extend 'org.jenkinsci.lib.configprovider.AbstractConfigProviderImpl' - have a look at 'org.jenkinsci.plugins.managedscripts.ScriptConfig.ScriptConfigProvider'
Help and Support
For Help and support please use the Jenkins Users mailing list.
The comment list below is not monitored.
Known issues
History
Version 3.6.2 (18. June 2019)
- attempt to fix JENKINS-48430 provided config file is sometimes not complete
Version 3.6.1 (5. June 2019)
- fix JENKINS-57417 'configFileProvider / withCredentials not working in declarative pipeline' → properly populate environment variables (thanks to Richard Davis/crashvb)
- fix JENKINS-48562 Inline Environment Variables not replaced in config file
- integrate PR#64 display provider id in the list (thanks to imaemo)
Version 3.6 (22. Mar. 2019)
- add new config file type: Properties (PR #58, thanks to victorsalaun)
- JENKINS-55787 Switch labels from entry to checkbox (PR #62 thanks to jsoref)
- localize provider config (PR #61, thanks to jsoref)
- Provides documentation for configuration (PR #60, thanks to damianszczepanik)
- Link the radio buttons with the label (PR #59, thanks to MRamonLeon)
Version 3.5 (28. Jan. 2019)
Version 3.4.1 (1. Nov. 2018)
- fix JCasC support (PR #56)
Version 3.3 (11. Oct. 2018)
- JENKINS-53247 support for JCasC
Version 3.2 (25. Sept. 2018)
Version 3.0 (3. Sept. 2018)
fix AnonymousClassWarnings PR #50
make sure config file Ids are alphanumeric
Version 2.18 (12. Mar. 2018)
- JENKINS-40803 allow plugins to specify the config file resolution context
- JENKINS-47502 fix broken Alphabetical Sort by Name
Version 2.17 (17. Jan. 2018)
- JENKINS-48476 PCT fails against core 2.73+
- integrate PR #43 If credentials are missing, at least note this in the build log
- JENKINS-48956 - Enable PCT and whitelist java.util.Collections$EmptyMap
Version 2.16.4 (22. Sept. 2017)
- JENKINS-46925 add support for custom folder types
Version 2.16.3 (14. August 2017)
- JENKINS-45399 View selected scripts doesn't show correct script
Version 2.16.2 (7. August 2017)
- SECURITY-513 protect access to config files, only allow users with granted permissions to view config files
Version 2.16.1 (26. July 2017)
- JENKINS-44740 Wrong permission type for Config File Provider credentials
Version 2.16.0 (22. May 2017)
- JENKINS-42877 Improve Config File Management screen inside a folder
- JENKINS-43787 GlobalMavenSettingsConfig#getServerCredentialMappings() may return null when MavenSettingsConfig#getServerCredentialMappings() doesn't
- JENKINS-43372 IllegalArgumentException: providerId can NOT be null when using configFiles
- JENKINS-42262 Provide a method where extension could implement own logic for the content of custom Config
Version 2.15.7 (17. March 2017)
- JENKINS-42389 Modifying Folder configuration removes all config files
Version 2.15.6 (13. Feb. 2017)
- JENKINS-41871 provide a way to create config files via script -> provider.newConfig(id, name, comment, content)
- fix JENKINS-41767 default implementation for config.getDescriptor()
Version 2.15.5 (19. Jan. 2017)
- fix JENKINS-41161 Config files not being updated
- fix JENKINS-40973 clearer error message if Id is not given to configFileProvider pipeline step
- integrate JENKINS-12114 users having permission to configure folder, are now allowed to edit config files on the same folder
- Delete per-provider configuration files that are not needed any longer (PR#32)
Version 2.15.4 (13. Jan. 2017)
- fix JENKINS-40901 Update plugin versions to avoid PCT issues.
- fix JENKINS-40981 IllegalStateException when installing plugin
- fix JENKINS-40943 Config files are not updated via Job DSL plugin
- Partialy restore binary compatibility with 2.13 and older releases (PR#29)
Version 2.15.3 (06. Jan. 2016)
- fix JENKINS-40788 JENKINS-40844 JENKINS-40773 JENKINS-40737 Managed script/configs aren't found/cannot be read/throw exceptions
Version 2.15.1 (27. Dec. 2016) DO NOT INSTALL!!
- fix JENKINS-39991 Credential replacement in settings.xml losts configuration, filePermissions and directoryPermissions elements
Version 2.15 (27. Dec. 2016) DO NOT INSTALL!!
This version has a lot a lot of the internal changes to support CloudBees Folders Plugin - to make this work, the configuration is now saved different then it used to and a rollback of this release is not supported. If you'r unsure, please save your configuration before updating.
Because of this change, also a couple of other plugins had to be updated (some might not have released there latest changes):
- Managed Script Plugin -> version 1.3
- Job DSL Plugin -> version 1.56
- Pipeline Maven Plugin PR#10
- Openstack Cloud Plugin PR#121
- integrate CloudBees Folders Plugin plugin (JENKINS-38872) This is a major refactoring and
- fix JENKINS-39998 Token expansion of a config file not happening in pipelines
Version 2.13 (9. Sep. 2016)
- add proper pipeline DSL support
- fix error after trying to view json file JENKINS-36442
Version 2.11 (24. June 2016)
- Allow to manage SSH keys in settings.xml - JENKINS-33165, PR#15 (thanks to Cyrille Le Clerc)
- migrate to credentials plugin 2.1+ - JENKINS-35527
- support variable substitution in file content with TokenMacro for buildwrapper and build step - JENKINS-32908
- clarify use of "Replace All" for Maven settings.xml - JENKINS-30458
Version 2.10.1 (29. March 2015)
- integrate fix for JENKINS-27152 Use a standardized directory for managed files (PR #13)
Version 2.10.0 (7. Dec 2015)
- integrate PR #12 Support user defined config file ID to ease usage of config file provider in workflow (thanks to Cyrille Le Clerc)
Version 2.9.3 (20. Aug 2015)
- fix JENKINS-29805 server credentials don't show up in maven settings.xml
- fix JENKINS-24441 some icons missing
Version 2.9.2 (4. Aug 2015)
- add support for Pipeline Plugin (JENKINS-26339)
- fix JENKINS-25031 Credentials metadata leak in ServerCredentialMapping
Version 2.8.1 (11. May 2015)
- add option to preserve 'server's in managed maven settings.xml
Version 2.7.5 (8. Aug 2014)
- fix JENKINS-20482 NPE in config-file-provider cleanup task
Version 2.7.4 (30.March 2014)
- fix JENKINS-21494 Credentials are not injected in the settings via the environment variable PR #6
- Improved target path parsing for Config File PR #5
- some spelling fixes PR #7
Version 2.7.1 (4.Nov. 2013)
- fix JENKINS-20403 HTTP 500 error on "view selected file"
- fix supplySettings() Gist 7301273
Version 2.7 (3. Nov. 2013)
- implement JENKINS-16705 support for server credentials in settings.xml (integrated with Credentials Plugin)
Version 2.6.2 (17. Sep. 2013)
- fix JENKINS-19076 Guice provision errors at startup
Version 2.6.1 (1. Aug. 2013)
- disabling support for credentials in settings.xml - sorry, there are some concept changes to be done to keep it in sync with the credentials plugin
Version 2.6 (23. July 2013)
- Adds support for credentials in settings.xml JENKINS-16705
- Order config files by name JENKINS-18325
Version 2.5.1 (2. June 2013)
- fix JENKINS-17555 Environment variables not set for maven projects types
Version 2.5 (15. March 2013)
- fix JENKINS-17031 add support for JSON files by adding a new provider/file type
- fix JENKINS-16694 Config-file-provider does not submit modified file
Version 2.4 (12. Dez 2012)
- implement JENKINS-15962 Provide BuildStep that publishes selected config file.
- implement JENKINS-14823 allow environment variables in Target definition
- fix JENKINS-15976 Provided maven settings.xml in maven builder is lost
Version 2.3 (19. Nov 2012)
- depends on core 1.491
- Implement new EP of core to provide maven settings and global settings for maven project type and maven build step
- remove dependency to maven-plugin
- fix JENKINS-14914 Errors in hudson-dev:run relating to config-file-provider
- implement JENKINS-15197 Add support for Maven toolchains configuration file (pull #3)
Version 2.2.1 (27. April 2012)
- Fixed JENKINS-13533 Maven build fails on CleanTempFilesAction#tempFiles serialization
Version 2.1 (16. April 2012)
- Fixed JENKINS-12823 Clean up temporary config files at the very end, not before post-build
Version 2.0 (3. April 2012)
- lift dependency to core 1.458
- change dependency direction between maven-plugin and config-file-provider-plugin (maven-plugin -> (optional) config-file-provider-plugin)
- upgrade to version 1.2 config-provider-model
Version 1.2 (8. Nov. 2011)
- upgrade to version 1.1 config-provider-model
- upgrade to dependency to core 1.438 (required to better decouple dependencies)
- enhance API to better support config-file-provider extensionpoint
Version 1.1 (29th August 2011)
- fix JENKINS-10770 - make sure config files are available for m2-extra-steps
- add new file types: groovy, xml
- allow definition of a variable name to access the config file location
Version 1.0 (16th August 2011)
Attachments:
JIRA Comments.jpg (image/jpeg)
Build Details.jpg (image/jpeg)
edit.png (image/png)
type.png (image/png)
new-edit.png (image/png)
freestyle.png (image/png)
manage-home.png (image/png)
maven-plugin.png (image/png)
new-edit.png.jpg (image/jpeg)
maven-plugin.png.jpg (image/jpeg)
edit.png.jpg (image/jpeg)
freestyle.png.jpg (image/jpeg)
manage-home.png.jpg (image/jpeg)
type.png.jpg (image/jpeg)
manage.jpg (image/jpeg)
cfg-files.jpg (image/jpeg)
add_file.jpg (image/jpeg)
new_file.jpg (image/jpeg)
Screen Shot 2013-07-28 at 16.20.54.png (image/png)
Screen Shot 2013-07-28 at 16.18.51.png (image/png)
Screen Shot 2013-07-28 at 16.23.32.png (image/png)
Screen Shot 2013-11-03 at 18.30.48.png (image/png)
Screen Shot 2013-11-03 at 18.33.56.png (image/png)
pipeline-syntax-screenshot.png (image/png)
Screenshot_2018-12-11_094438_001.png (image/png)