scm-sync-configuration-plugin icon indicating copy to clipboard operation
scm-sync-configuration-plugin copied to clipboard

how to reload scm configuration programmatically

Open PeterLappo opened this issue 8 years ago • 7 comments

I'm writing an Ansible script that installs Jenkins and loads SCM config from git. I've got most of it working but can't figure out how to invoke http://:/plugin/scm-sync-configuration/reloadAllFilesFromScm from a curl script to force Jenkins to use the config from git. A curl scripts seems to be the obvious way to do it but can't get it to work. Any ideas?

PeterLappo avatar Jul 13 '16 23:07 PeterLappo

Interested too

xussof avatar Nov 02 '16 11:11 xussof

+1

davidx avatar Nov 08 '16 19:11 davidx

Trying to solve same issue :+1:

IsNoGood avatar Nov 28 '16 12:11 IsNoGood

I managed to do it:

Using ansible:

  • name: Autoload scm configure become: true become_user: jenkins shell: "curl http://localhost:8080/plugin/scm-sync-configuration/reloadAllFilesFromScm -u admin:{{ initialpassword.stdout }}" notify: restart jenkins

  • name: Autoload scm configure become: true become_user: jenkins shell: "curl http://localhost:8080/reload -u admin:{{ initialpassword.stdout }}" notify: restart jenkins

Bash: curl http://ip-address:8080/plugin/scm-sync-configuration/reloadAllFilesFromScm -u admin:password curl http://ip-address:8080/reload -u admin:password

xussof avatar Nov 28 '16 13:11 xussof

nice one, thanks

PeterLappo avatar Nov 29 '16 22:11 PeterLappo

@PeterLappo How did you manage to set the plugin configuration with Ansible? Can you provide the complete tasks list?

lmilbaum avatar Jan 27 '17 07:01 lmilbaum

@xussof To reload Jenkins a POST is needed:

curl -X POST http://ip-address:8080/reload -u admin:password

This worked for me.

martku avatar Mar 21 '17 13:03 martku