Is there (an automated) way to backup Hudson CI files?

后端 未结 6 1962
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-06 05:37

Here at my company we have three Hudson CI servers with 100+ jobs configured. We are looking for an automated way to periodically backup job configurations and

相关标签:
6条回答
  • 2021-02-06 05:41

    There is a Backup Plugin.

    I don't believe that it supports scheduling of periodic backups, but you might be able to trigger it by accessing it through the URL (like some other Hudson remote APIs), in which case you might be able to simply set up a cron job to ping the URL.

    0 讨论(0)
  • 2021-02-06 05:44

    There is awesome thinBackup plugin.

    It backups only system configuration and job configurations instead of whole HUDSON_HOME directory and has cron-like scheduling. Sexy!

    0 讨论(0)
  • 2021-02-06 05:45

    I would manage it with a standard enterprise server backup solution.

    Or roll my own with something like BackupPc.

    Or check the config files into your version control system.

    0 讨论(0)
  • 2021-02-06 05:53

    I am using thinbackup, which supports full backup and differential backup, and you could schedule when it runs the backup using cron job like syntax. It only backups the critical configurations so it doesn't take much spaces.

    See more details at: https://wiki.jenkins-ci.org/display/JENKINS/thinBackup

    0 讨论(0)
  • 2021-02-06 05:53

    Besides the Backup plugin there is also the thinBackup plugin to backup only the configuration files (available for Hudson or Jenkins)

    I personally like to do all system backups via one system that is usually a shell script in the end. I wrote a Jenkins specific script for that (works for Hudson too). See https://bitbucket.org/toomasr/jenkins-stuff/src for more information.

    0 讨论(0)
  • 2021-02-06 05:56

    My Hudson servers run on windows, so I use Robocopy for this. I have it mirror all files in each build server's hudson home, excluding job workspace directories. Since the backups are going to a central place, I have a scheduled task on a fileserver that runs my script nightly, and the Hudson servers are unaware of the process.

    The script has one entry per hudson machine:

    robocopy path-to-buildserver-hudson-home backup-folder-path\buildserver-name /ZB /E /NP /R:1 /W:5 "/LOG:%~dp0backup_log.txt" /TEE /XD workspace

    Note: after the first machine, it becomes /LOG+: instead of /LOG: so that the next ones append to the log.

    This mirrors without deleting files that don't exist in source, so even if Hudson is setup to delete build results after X months or Y builds, the backups could still have the full history...as well as logs to console and a file, and is resumable if it gets interrupted. It's handy. If you didn't want it to retain files Hudson has deleted, you could use /MIR instead of /E.

    I'm sure similar tools for robust copies or mirroring exist on other platforms. Ant is probably sufficient if done right.

    0 讨论(0)
提交回复
热议问题