set the record straight

Let me make this clear; Jenkins is a great CI server. It has several features that most CI servers wish they got for Christmas. A thumbs-up to all the contributors to this project. Your hard work can not be overlooked.

had a bad day

If you’re starting to use Jenkins, you are utterly fucked! Here is why:

  • very steep learning curve
  • a near-complex user interface
  • written in Java (sorry but java sucks for me; discussion for another day)

Now here are some of the difficulties I encountered and resources that might turn out to be useful.

help me

cloning private repos:

You can go ahead and add credentials (SSH with username) but if that does not help:

  1. log in (ssh) to the machine running your CI server
  2. copy the contents of jenkins’s ssh public key at ~/.ssh/jenkins_id_rsa.pub
  3. add the key to the repository settings (or your account settings) in bitbucket, etc.

In OpenShift, you should find the key file at ${OPENSHIFT_DATA_DIR}/.ssh/jenkins_id_rsa.pub

webhooks:

It would be nice to have your jenkins server run builds once you push commits. Assuming you intend to keep your repository private, anonymous users should not be able to start builds. This is how I did it:

  1. take note of your jenkins url e.g. https://ci-server.com/
  2. and your job name e.g. jenkinsProjectName
  3. for authentication, get your jenkins username e.g. myJenkinsUsername
  4. and your jenkins api token from https://ci-server.com/user/myJenkinsUsername/configure e.g s0m3tok3nfRomJ3nkin5
  5. generate some random long string, for example, using uuid
  6. configure a build trigger, i.e. trigger builds remotely, with the string as its authentication token in the repo configuration in jenkins, usually at https://ci-server.com/job/jenkinsProjectName/configure
  7. now construct a nice url in the form: https://myJenkinsUsername:myJenkinsApiToken@ci-server.com/job/jenkinsProjectName/build?token=jenkinsRepoAuthenticationToken

The url you just created can be used to configure webhooks from bitbucket, etc. This url should be kept private.

separate shell build steps:

Always remember, those build steps act like separate terminals. Imagine having opening several terminal windows with the build steps typed in. Surprise! Surprise!

see outptut for a multi-configuration project:

This StackOverflow question has some useful information on this issue.

i want emails:

Using the default email account, things might work. In the case (like mine), you would prefer using an email provider such as Mandrill.

Send 12,000 emails to 2,000 subscribers for free. No contracts, and no credit card required. It’s free forever

From http://mailchimp.com/pricing/ (at the time of writing)

finally

Now I wish I had someone to tell me all this. Went on a browsing rage to understand how to run a Jenkins server.

If you’ve got any more resources and tips, you should leave a comment. Let’s do good to one another!