Saturday, 23 March 2013

Git clone not working in Jenkins

Poor Jenkins&Git integration...

When I was trying to setup some git jobs in Jenkins today, it turned out to be more tricky than I initially expected.
Upgrading to latest Jenkins 1.506 and Git Plugin 1.3.0, we were off to a bad start:
Command "/usr/bin/git clone --progress -o origin ssh://
 /path/to/jenkins/jobs/test/workspace" returned status code 128: Cloning into an existing
directory is not allowed.

After quite a lot of digging, I finally found the root-cause, solution and a work-around...


Upgrade Git to at least version


Downgrade Jenkin's "Git client Plugin" to version 1.0.2 (Download from here:


"Cloning into an existing directory is only allowed if the directory is empty." only became reality in later versions of Git.
While Jenkin's "Git client Plugin" made a change (JENKINS-16873) in version 1.0.3 which relies on this feature, any installation with an older Git will fail to work.

Saturday, 9 March 2013

How to use Node.js with WebLogic OSB

I recently came across a situation where there was a requirement to use WebLogic OSB configuration in a Node.js application. The information in question was the Endpoint URIs for all Business Services found in the OSB.
Since WebLogic removed "ServiceConfigurationMBean" from WLST in 11g, writing a Python script as you normally do was out of the question. Using Java was the only possibility at this stage, but it felt a bit much writing a new app just for a simple task like this.

This is when a college pointed me to which is a module to write native Java which is then executed inside your javascript using Node.js.

It turned out to be very straight forward and I added a sample JavaScript here:

In order to run the script, you will need Node.js, Java and some WebLogic libraries.
The WebLogic libraries been specified in the getbs.js file as:
Copy those files to the current working directory and update any version numbers as necessary.

Next, define your connection options:
var config = {
        admin_server: {
            "hostname": "",
            "port": 9001,
            "username": "weblogic",
            "password": "w3blogic"

And then run it:
node getbs.js

If all goes well, it will output something similar to this:
qwerty/business_services/qwerty_bs       =>