Continuous Integration -- Getting Started

This series will demonstrate how to set up a continuous integration (CI) environment for ColdFusion projects using Jenkins CI and MXUnit. We’ll cover Jenkins setup, MXUnit test runs and JUnit XML output, and a few notification mechanisms (email, IM).

I will not attempt to duplicate the quite thorough documentation available for Jenkins. Rather, I intend to cover enough "getting started" material, and then focus on instructions specific to MXUnit and Jenkins

Big Picture

  1. You and your peeps write code and commit it to your source control repo
  2. Jenkins recognizes those commits (it can pulse SCM, or it can run every XXX hours/minutes/whatever)
  3. Jenkins runs "build actions" – ANT targets, shell scripts, gradle tasks, whatever
    1. Use SVNAnt, git, post-commit hooks, or some other means to get the latest code onto your target server (usually DEV)
    2. Use ANT to run your MXUnit tests on the target server
    3. MXUnit test results are stored as XML files inside of Jenkins
  4. Jenkins reads the XML files and generates pretty reports of test results
  5. Jenkins sends notifications (email, IM, etc) when the build fails, tests fail, etc

Installing Jenkins

This will cover the simple way to run Jenkins, which is to use its built-in Winstone container, which is fine for testing and has served me well in a medium-load production environment. If you already have Tomcat set up, then you know how to install war files so follow that procedure instead (i.e. drop the war where you put your war files, or use the admin to deploy the war. It's that simple)

  1. Download the Jenkins war file and put it somewhere
  2. Open a command line and navigate to the war file location
  3. type “java --jar jenkins.war”
  4. This will launch Jenkins. You can navigate to http://localhost:8080 and from there, you’re ready to start
  5. If you're on Windows, you can install Jenkins as a Windows service from inside "Manage Jenkins".

Pulling your project from Subversion (SVN)

  1. Click "create a new job"
  2. Give your job a name, and then select Freestyle Software Project
  3. Under Source Code Management, select SVN, and then plug in your project’s SVN location, eg http://svn.myproject/whatever/trunk
  4. In the "Local Module Directory" field, I typicaly use the name of the directory as it will be deployed onto some production server. So if I'm checking out myproject/trunk, I'll use  "myproject". The reason is that I'll often check out from multiple places in a single Job, and giving each module directory a proper name helps with organization.
  5. From here, you can click “Save” and then perform a build by clicking “Build”. This will check out your code into the Jenkins workspace for your project

But this code isn’t where I need the code to be! Good point. We'll talk more about that later

What's Next?

See how easy that was? Next up, configuring ANT , running your tests, and recording results

Labels

jenkins jenkins Delete
hudson hudson Delete
continuous continuous Delete
integration integration Delete
automation automation Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.