All Projects → jenkinsci → config-file-provider-plugin

jenkinsci / config-file-provider-plugin

Licence: other
Jenkins plugin to administrate the maven settings (settings.xml).

Programming Languages

java
68154 projects - #9 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to config-file-provider-plugin

parse it
A python library for parsing multiple types of config files, envvars & command line arguments that takes the headache out of setting app configurations.
Stars: ✭ 86 (+100%)
Mutual labels:  configuration, configuration-files
swiss-army
Ansible-driven configuration management for maintaining a preferred environment (base system and app dotfiles / configurations)
Stars: ✭ 44 (+2.33%)
Mutual labels:  configuration, configuration-files
climatecontrol
Python library for loading settings and config data from files and environment variables
Stars: ✭ 20 (-53.49%)
Mutual labels:  configuration, configuration-files
neovim-config
Modern NeoVim config for IDE-like development
Stars: ✭ 89 (+106.98%)
Mutual labels:  configuration, configuration-files
puppet-augeasproviders
Alternative Augeas-based providers for Puppet
Stars: ✭ 64 (+48.84%)
Mutual labels:  configuration, configuration-files
awesome-pro
Awesome WM 4.x themes configs
Stars: ✭ 91 (+111.63%)
Mutual labels:  configuration, configuration-files
config-parser
A slim, fully managed C# library for reading/writing .ini, .conf, .cfg etc configuration files.
Stars: ✭ 67 (+55.81%)
Mutual labels:  configuration, configuration-files
zsh-launchpad
🚀 Simple, educational dotfiles template to get started with Zsh and learn about its features
Stars: ✭ 141 (+227.91%)
Mutual labels:  configuration, configuration-files
intelirest-cli
A cli interpreter for intelliJ .http files
Stars: ✭ 23 (-46.51%)
Mutual labels:  jenkins
nvim
❤️ A neovim config repo.
Stars: ✭ 33 (-23.26%)
Mutual labels:  configuration
srcery-terminal
Srcery theme terminal configurations
Stars: ✭ 183 (+325.58%)
Mutual labels:  configuration
plasma-dotfiles
In this repository I intend to keep configuration files that I deem important, in addition to the theme customizations that I make to have a consistent working environment.
Stars: ✭ 58 (+34.88%)
Mutual labels:  configuration-files
event-recommender-festa
[SI -> 오늘회, 펫프렌드 이직, 연봉 35% 상승] 내 주변지역의 이벤트와 행사를 추천해주는 서비스
Stars: ✭ 64 (+48.84%)
Mutual labels:  jenkins
go-config
Configuration file loader for Go
Stars: ✭ 27 (-37.21%)
Mutual labels:  configuration
SeleniumTDD
A Selenium TDD framework that incorporates key features of Selenium and TestNG which can be used to create web-based automation scripts.
Stars: ✭ 23 (-46.51%)
Mutual labels:  jenkins
icingaweb2-module-fileshipper
Provide CSV, JSON, XML and YAML files as an Import Source for the Icinga Director and optionally ship hand-crafted additional Icinga2 config files
Stars: ✭ 25 (-41.86%)
Mutual labels:  configuration
black-postoffice
[무신사 신입] 익명으로 편하게 고민, 일상을 공유하는 소셜 네트워크 서비스입니다.
Stars: ✭ 31 (-27.91%)
Mutual labels:  jenkins
devops-jenkins-box-template
Bootstrap template to provision your agency own Jenkins server
Stars: ✭ 22 (-48.84%)
Mutual labels:  jenkins
kerrigan
基于Tornado实现的一套配置中心,可基于分项目、环境管理配置,语法高亮、对比历史版本、快速回滚等,并提供Restful风格的API
Stars: ✭ 57 (+32.56%)
Mutual labels:  configuration-files
dotatom
Config for the Atom text editor
Stars: ✭ 15 (-65.12%)
Mutual labels:  configuration

Config File Provider plugin for Jenkins

config file provider config file provider plugin config file provider

Adds the ability to provide configuration files (i.e., settings.xml for maven, XML, groovy, custom files, etc.) loaded through the Jenkins UI which will be copied to the job’s workspace.

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:

image

Edit an existing file or add a new file:

image

Choose the configuration type:

image

Edit the content:

image

Configure the Maven plugin to use it:

image

Provide any config file to a project

image

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.
image

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 as well, 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).
image

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.

image

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.

image

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

builds are currently executed on:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].