Tuesday, February 25, 2014

Setting up a Windows 2012 Jenkins slave from a Linux Jenkins master

There are some caveats to setting up a Jenkins slave on Windows (e.g. Windows 2012) from a Linux master box.

To accommodate building on Windows 2012 from a master Jenkins server (where you may already have linux master to linux slave) I'd advise this high-level setup within the Jenkins master.

     1) Two JDKs defined in the Jenkins config: one for linux, the other for windows 2012.
     2) Two Perforces (or whatever your SCM solution is) defined under Jenkins config too: one for linux, and one for windows 2012.

Also, when you set up a JDK and Perforce in Jenkins for Windows you'll get Jenkins errors in a couple of places in the Jenkins web pages, which you'll need to disregard.

This will most likely be in the paths that will have forward slashes (/) instead of the Windows backslashes (\) to both the JDK and Perforce directories. Yes, you need to use forward slashes instead of the Windows backslashes for some of these paths.

Most likely, after these step, you'll use the JDK and SCM setups in a Maven build project.

In your Maven build project, make sure that:

     1) Your root POM for windows uses backward slashes
          a) for example: \some-directory\maven-directory\pom.xml
     2) Your archive directory also uses backward slashes
          a) for example: **\some-directory\assembly\target\archive-file*.zip

Again, you'll also encounter Jenkins error messages when setting up these two items in source code management. You can also disregard that too.

Ultimately, the best way to make sure things are working is actually run a build, look at the log and disregard some of the misplaced warnings/error messages.