MATLAB: Matlab and Jenkins CI

ciJenkins

In brief, I'm hoping to take over a matlab project of moderate complexity. The strategy is to unit test. My experience is that continuous integration is a very effective tool for automating these kinds of activities. I've tried to follow this post;
But I'm stuck. Matlab appears to not communicate with any other process which spawns it – I've tried from the command window and I have the same problem. In the blog post, Andrew Campbell is able to print 'hello world' to the jenkins console via the matlab process.
I cannot achieve this, or actually even get the matlab splash info to be displayed in either jenkins or just a pure cmd window. Even using the -nodesktop modifier, it simply spawns it's own custom console rather than using the existing one.
I have matlab R2015a and windows 8.1.
Has anyone successfully setup Jenkins on windows with Matlab? I'm hoping someone can confirm it should be possible possible before I spend more time on it? It's the sort of thing I had hoped would be easy :-(.

Best Answer

So, it appears to depend on how you install Jenkins. To someone reading this who wants matlab - Jenkins CI on windows. Some hints;
Do NOT install jenkins as a windows installer from the jenkins homepage It sets itself up as a windows service with some sort of service account. I didn't have permission to mess with that and set it to be myself, so I and ended up in a world of pain.
For success, suggest a different strategy of setting up your own webserver and hosting jenkins inside. Sounds harder than it is;
  1. download and extract tomcat from a zip file
  2. download jenkins war file and place in webapp directory of downloaded tomcat
  3. modify tomcat-users.xml to include yourself as a tomcat user with manager-gui role
  4. setup the JAVA_HOME enivronment variable to reference your java installation
  5. move to tomcat bin dir and type 'start' ... for whatever reason, this appears to be the key part as it means jenkins ends up running as you, not a service account.
Note that you now have a potentially unsecured webserver available to whoever can see your computer... this may not be wise.
However you can now follow the instructions Andrew lays out in the two CI blog posts and actually automate running some tests - woot.