This is current as of Jenkins LTS (1.580.3)
- create a .gitignore file in your $JENKINS_HOME with the following
- this may need tuning to your liking
- ie storing artifacts etc
- setup some ENV variables for the user that jenkins runs under.
- I add the following to /home/jenkins/.bashrc
- and restart jenkins
export GIT_AUTHOR_NAME="Sir jenkins"
export GIT_AUTHOR_EMAIL="[email protected]"
export GIT_COMMITTER_NAME="Sir Jenkins"
export GIT_COMMITTER_EMAIL="[email protected]"
- create a new Jenkins periodic job with this bash script.
Hi!
I've tried to do it the other way around and ignore everything except XML-files, plugins and nextBuildNumber. This is what I ended up with. Just an idea :)
== .gitignore ==
*
!README
!.gitignore
!.xml
!nextBuildNumber
!jobs
!jobs/
!plugins
!plugins/*.jpi
== Script ==
git add -A
git commit -m "Config backup"
git push