Wednesday, September 14, 2011

What's so difficult, dude?

I have no idea!

How many times have you asked yourself this question? In the last couple of days I asked this question numerous times.
I'm currently working on some enhancements for a gradle plugin to simplify Flex development. This feels so slow and error prone, even if the task is not really complicated and it's not overly complex. But I'm stuck somewhere in the tools.

First: I'm no expert for IntelliJ! Not yet!
Since I used to work the last 10 years with Eclipse and I was very fluent with keyboard shortcuts, everything feels so different and complicated.
What is the shortcut to open all Implementors of this Interface in IntelliJ? I don't know yet. But this gets better from day to day. I found this nifty functionality triggered by Cmd+Shift+A. This will bring up a Popup window where you can search for an action and it shows the keyboard shortcut.

Second: The other unknown to my equation is gradle itself
It's not always obvious how the things are related and wired together. Don't get me wrong: Gradle is a great tool, but developing a plugin for gradle that does a little bit more than 'Hello Build', and finding the right pieces to use, is not always that easy. What makes it more complicated than necessary, is the fact that my dev env setup is probably not optimal to make this tasks easy.
Having two different projects (gradle and GradleFx) and trying to debug something in the latest gradle snapshot, is not really working for me. For that reason I started to write some unit tests, in order to increase my confidence level about my written code. But this only worked to a certain extend. Now I'm stuck in writing some, IMHO, basic unit tests and I can't do the simplest things without digging too deep into the internals of gradle.

Third: Probably it always too late for writing code.

Let's see what tomorrow brings.

Monday, August 22, 2011

Notable changes in Jenkins OS X installer 1.427

Okay, nearly every every week there is a new version of the installer available. With every Jenkins release you will also find a new installer for OS X. But that's nothing new. With release 1.427 it's time to tell a little bit about the recent changes in the installer. What else has been changed in the latest Jenkins release can be found here. The installer can be downloaded from here.

What's new in this release?

There were a lot of changes in the recent versions, but I'm going to mention them here too (since they have never been mentioned anywhere else)
  • Installation as launch daemon instead of launch agent. If you don't know the difference, here is a good explanation.
  • By default Jenkins will be installed as launch daemon, but the user can choose to not install it as launch daemon. In this case only the jenkins.war get's installed. Please start jenkins on your own.
  • There is a preference file available to easily tweak the Jenkins program arguments like JENKINS_HOME, prefix, httpPort, etc.
  • Documentation with instructions on how to change the arguments by modifying the preference file. The documentation will be installed and is available from /Library/Documentation/Jenkins or you can have sneak peak here.
When it comes to the installation process you will find something like this. More options than ever before. ;-)
Kudos to Sami Tikka for adding the recent improvements.

What's next?

There is currently one big improvements "work in progress": the PrefPane! This will allow you to easily modify the Jenkins settings, start and stop Jenkins, open the logfile, etc.
There is no planned release date for it, but I think it will be available before Christmas 2011.

You have ideas for improvement?

Let us know. We are happy to resolve issues that could ease your life dealing with Jenkins on OS X. The easiest way is to create a new ticket here. If you want to contribute some code, you can even do this by forking the repo on github and start working on it.

Tuesday, July 26, 2011

List all jenkins jobs with a perforce scm configuration

Here is an instruction on how to execute this groovy script on your jenkins instance to display all jobs that use perforce as SCM provider. This was one of the first scripts I wrote to get an idea about the jenkins CLI and how to execute custom scripts. This script can be used to examine your perforce configurations used for your jobs. In my case it was the foundation to change all passwords for certain perforce user.

Prerequisites
You need to have a java installation on your machine and java must be available on your PATH. groovy itself is not required to execute the scripts.
I assume that you have Jenkins running on your machine, so that I refer to localhost to access the Jenkins instance.
  1. If you already have a copy of jenkins-cli.jar on your machine, then skip to step 2. Otherwise open a browser and navigate to this URL http://localhost:8080/cli. Follow the instructions and download the jenkins-cli.jar to a known directory
  2. Open a terminal or command window and change into the directory where your jenkins-cli.jar is located
  3. Type java -jar jenkins-cli.jar -s http://localhost:8080 help. This will output a list of all available commands that this jenkins instance provides.
  4. Okay, now go ahead and save this snippet as listAllProjectsWithPerforceSCM.groovy to the same directory where you previously downloaded the jenkins-cli.jar
  5. Now enter the following on the command line:
    java -jar jenkins-cli.jar -s http://localhost:8080 groovy listAllProjectsWithPerforceSCM.groovy
This will show you something similar to this output:

Job 'Test' uses the following perforce configuration
------------------------------------------------------------------------
P4Port: localhost:1666
P4Client: testbuilder
P4User: testbuilder
P4Password: 0f0kqlwaDeXrEj0PA0z/+IXZM1f8G8QsgBlUgnUv8bbR2bzXLfa3AlrK8xqw==

That's it. There is nothing complicated about this script, but it shows some of the capabilities to automate certain tasks. Take the script as example to play around with it and explore new ways to interact with jenkins.

Thanks for reading this post.

Thursday, July 14, 2011

ConfigSluper, ConfigObject and some stupid bugs

In my last project I wrote some scripts to handle the automatic integration of libraries from different Version Control Systems into our source code repository.
I wrote a script to generate an XML file, that served as input for an existing perl script.

To generate the XML file I used a groovy script which described the dependent components and the revision as well as the platform dependent location in the VCS (which is omitted here).



Processing this file is a pretty straightforward task.



The reason why I'm writing this up, is to tell that I spent a good amount of time, figuring out if there is a bug in the underlying ConfigObject. The ConfigObject is created by ConfigSluper().parse(...) and represents the data in-memory. Since ConfigObject inherits from LinkedHashMap, one can assume (and I really did!), that the semantics are like using a HashMap. But I was wrong! There happens some _magic_, when you do the following:



In my script there was a piece of code that relied on the sub-node count of the Component node. At a certain point, I was really convinced that I found a bug. But that would have been too obvious IMHO, that this kind of misbehavior had slipped through all testcases.
To make a long story short. I did some investigation and found the reason in the implementation of the ConfigObject


You can find the secret (if you will) in line 8. If you access a key in the ConfigObject that doesn't exist, then there will be an empty one created on the fly. This is not really bad, as long as you don't rely on the amount of nodes before and after querying the ConfigObject.

Monday, April 18, 2011

Jenkins OSX installer

Two weeks ago, I started to work on a simple OSX installer for Jenkins. Last week my work was accepted by Kohsuke and submitted to the repository. Now you can find the installer for the lastest Jenkins release here.

What does the installer do?
  • copies the jenkins.war to /Applications/Jenkins
  • create a simple LaunchAgent property file (org.jenkins-ci.plist) and add Jenkins as a service
    with a specific JENKINS_HOME location in /Users/Shared/
  • start the new Jenkins service after the installation finished
That's it basically.

You can find the installer project on github.

Friday, April 15, 2011

What I did last Thursday: Attending the "Continuous Integration Summit" at LinkedIn HQ

Last week I went to down Mountain View to attend the Continuous Integration Summit. The Event was hosted by LinkedIn in their HQ. I think there were about 100 attendees for this event and the demos from LinkedIn employees about their build system was very interesting. jfrog showed some interesting features for a tighter integration between jenkins und artifactory (for build artifact publishing). Kohsuke Kawaguchi (Jenkins) presented the current state of the Jenkins project and what has changed since the fork from hudson happened. Hans Dockter demoed gradle and how it helps to simplify the build process. All together an event that was worth the time spent. I'm looking forward to the next Summit and a much greater audience.

 

Bay Bridge or Donut? Or both?

Baybridge

Monday, April 11, 2011

Bike tour through the hills of my new Hometown

Today I did a tour with my bike from Castro Valley to San Ramon. It was a good exercise and finally the hills have not been as steep as I assumed in the beginning. But it was still enough for someone from the flat land in northern Germany. ;-)

After 4,3 mi (7 km) I had some trouble with my back tire: due to little stones and glass on the shoulder, I got a flat tire that I had to replace instantly next to the street. After I changed the tube, my fingers were totally black and full of oil and dirt. Lesson learned: better keep your bike in clean condition, to avoid looking like having the hands of a mine worker. zatter 

The google maps track can be found here.

Img_20110410_162031
This is shortly before entering San Ramon

Wednesday, March 30, 2011

What a beautiful day in San Francisco

1687946534

That was the first day since January that felt like Spring. It was warm, sunny and the light at this time lets everything look very soft.

Monday, March 28, 2011

If you think you are tough, then give this guys a chance to rebuild your opinion

Two friends of mine quit their job, and do now what they are really passionate about: Road Cycling!

Beginning of January 2011 they started to cycle around the world, at least that was the plan the last time I talked to them (Esther?). They packed all the necessary stuff and flew from Scotland to New Zealand, where they started their tour. If you are interested in real live adventures and honest stories about beautiful places of this world, you should tune in and follow their blog. I'm really looking forward to meet them here in California.

Saturday, March 26, 2011

Monday, March 14, 2011

That could have been said by me

"Don’t do anything by half. If you love someone, love them with all your soul. When you go to work, work your ass off. When you hate someone, hate them until it hurts".

Henry Rollins