2

My Jenkins server has lot of embedded scripts (not script files) such as Groovy, Shell , Batch etc..

Is there anyway to keep track of the changes doing for these script by submitting the changes to a 'Version control system'

I found this Job Config History Plugin. But it only keep a copy of config file locally.

luka5z
  • 7,525
  • 6
  • 29
  • 52
Nayana Adassuriya
  • 23,596
  • 30
  • 104
  • 147

1 Answers1

0

The way I achieve this is by running a periodic job that runs a shell script to commits changes. I use this in conjunction with the thin backup plugin, which, similar to the Job Config History plugin, stores the backups locally. I basically let the plugin do all the work of backing up the specified configurations, and then it's a few lines of scripting to commit those backups to the repository.

Note: I use svn rather than Git, otherwise I'd pass along the shell script to do the commits. I believe there are resources out there already though that will give you the commands you need to commit to Git.

TheEllis
  • 1,666
  • 11
  • 18
  • Actually I'm considering this approach also because SCM Sync configuration plugin not easy to configure. I'm still couldn't figure out to make it work. – Nayana Adassuriya May 11 '16 at 13:17
  • Yes, I tried the SCM Sync configuration plugin and couldn't get it to work well for me. Also, the latest release has a fatal bug in it that requires a bit of manual configuration to reverse. – TheEllis May 11 '16 at 13:18