Hacker News new | ask | show | jobs
by Cpoll 3430 days ago
We use Jenkins, hosted on Amazon. We're .NET stack, so some of the other options didn't work.

Biggest lesson for us: Avoid putting all your logic into Jenkins templates. You're not capturing your CI/deployment logic in version control, and this can cause problems down the road (we backed up Jenkins regularly, but versioning was a weak point).

Instead, do as much as you can in scripts, and use Jenkins as a glorified crontab (+webhooks).

2 comments

Biggest lesson for us: Avoid putting all your logic into Jenkins templates. You're not capturing your CI/deployment logic in version control, and this can cause problems down the road (we backed up Jenkins regularly, but versioning was a weak point).

Jenkins Job Builder[1] is a great tool that solves exactly this problem. You write job definitions in yaml/json files. Then, check these yaml files into version control and run JJB to push these jobs to your Jenkins server.

JJB is great because it's purely a client. It requires no extra Jenkins plugins. Since all of your jobs are now captured in version control, you can reproduce your Jenkins jobs instantly in a local docker container or vagrant machine to dev/test change to your Jenkins jobs.

I really recommend trying it out. No more manually clicking around in Jenkins to configure things.

1: http://docs.openstack.org/infra/jenkins-job-builder/

> Biggest lesson for us: Avoid putting all your logic into Jenkins templates. You're not capturing your CI/deployment logic in version control, and this can cause problems down the road (we backed up Jenkins regularly, but versioning was a weak point).

We've found the Job DSL plugin pretty useful for backing jobs up. https://wiki.jenkins-ci.org/display/JENKINS/Job+DSL+Plugin

I'd also second the Job DSL plugin if you want to keep all your Jenkins config in version control.

Its also worth looking at replacing all your freestyle jobs with Jenkins Pipeline and have the job definition defined in a Jenkinsfile in your repository. We've got a new syntax coming out of beta shortly that makes the experience a lot more declarative thats worth a look https://github.com/jenkinsci/pipeline-model-definition-plugi...