You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to automate reload Jenkins config from scm (git) using this plugin. I use a groovy script during Jenkins startup to download the latest config from scm. I use following actions to re-load the config
The problem:
SCM plugin overrides Jenkins start method, and the groovy script is executed only after the plugin initialises, so the config file is overwritten already.
The solution: (provisioning with ansible)
Install jenkins
two separate groovy files, one for plugin installation and one for scm config reload.
First, place the plugin installation script in the init.groovy.d and restart jenkins
Wait for jenkins to be online again
Now clone the actual config repo somewhere (may be in /tmp)
Replace /var/lib/jenkins/config.xml with the config.xml from the cloned repository.
Place the scm-configuration xml in jenkins
Place the groovy script for scm config reload in init.groovy.d
Hi,
I am trying to automate reload Jenkins config from scm (git) using this plugin. I use a groovy script during Jenkins startup to download the latest config from scm. I use following actions to re-load the config
I am using groovy script from this gist - https://gist.github.com/gshively11/13dcdd61b78b7910923e#file-gistfile1-txt
....................trimmed............... .............. scmSyncPlugin.configure(mock, jsonObj) scmSyncPlugin.business.synchronizeAllConfigs(ScmSyncConfigurationPlugin.AVAILABLE_STRATEGIES) instance.doReload() instance.save()
It is working as expected but it overwrite the main config.xml and reset all my settings.
Any help would highly appreciated.
Thanks,
Arun S
The text was updated successfully, but these errors were encountered: