Continous Integration BW5.12/Jenkins - Part I

First some pre-requisites.

The workflow of a Continous Integration with BW would be (GIT is used in this case, same thing can be done with SVN or other source control tools as well):

Developer:

Jenkins:

The Jenkins job can be run manually, scheduled or, if configured correctly, with the source control system, on every check-in/push.

This article covers only a really abstraced view on the process, which can grow to complexity. Only some random thoughts what has to be clearly defined before setting up CI (without beeing complete):

Following steps have been done on a Windows Box (AWS Windows Server 2012).

Jenkins installation

  1. Go to Jenkins Homepage: http://jenkins-ci.org/
  2. Download Windows Package / Unzip and start >setup.exe<
  3. Choose the installation directory. After setup is completed (on my box) a browser pops up, showing Jenkins waiting for jobs.

Installation of Jenkins on Windows completed

If you need to change the port of Jenkins standard configuration, it can be changed by editing the jenkins.xml file (change httpPort=8080) which is located in the installation directory (choosen during installation).

Config file

This was my original config - useful to increase heapsize etc:

<service>
  <id>jenkins</id>
  <name>Jenkins</name>
  <description>This service runs Jenkins continuous integration system.</description>
  <env name="JENKINS_HOME" value="%BASE%"/>
  <!--
    if you'd like to run Jenkins with a specific version of Java, specify a full path to java.exe.
    The following value assumes that you have java in your PATH.
  -->
  <executable>%BASE%\jre\bin\java</executable>
  <arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080</arguments>
  <!--
    interactive flag causes the empty black Java window to be displayed.
    I'm still debugging this.
  <interactive />
  -->
  <logmode>rotate</logmode>

  <onfailure action="restart" />
</service>

After applying any change, restart the Jenkins Service using e.g. the Windows Task Manager. For this article I changed the Jenkins Port to 6060.

For more details (e.g. issues or advanced config, such as installing jenkins as a slave, check out: the jenkins wiki.

Preparation of BW5.12 scripted deployment

Within TIBCO BusinessWorks 5.12 ear-files (deployable artifact) are created via the TIBCO Utility/Script BuildEar. The deployment is done via the AppManage Utility. Both are available after installation of BW TRA.

The AppManage utility must be run on a machine that is part of the administration domain you are updating.

Example manual steps for deploying an application:

AppManage -deploy -ear D:\jenkins\ears\deployment\helloworld_service2.ear -deployconfig D:\jenkins\ears\deployment\hello_service-bw5_dev.xml -cred D:\jenkins\cred.txt -app TestServices/hello-service -domain bw5_dev

In this case we would deploy & start a service within the TestServices folder. The AppManage Tool is located in the tra folder of your installation (e.g. C:\tibco\tra\5.9\bin).

The ear file can be created automatically via the build tool:

buildear.exe -s -ear /helloworld_service.archive -o D:\jenkins\ears\deployment\helloworld_service2.ear -p C:\Users\Bob\Documents\bw5\helloworld_service

Options:

The buildear is located in the same directory as the AppManage Tool. For more specific explanations check the Tibco Documentation!

Before deploying, as mentioned before, the config file has to be created (by AppManage) and adjusted to the target environment where the deployment will happen (usually a clever script).

Export the config of an existing ear.

AppManage -export -ear  D:\jenkins\ears\deployment\helloworld_service2.ear -out D:\jenkins\ears\deployment\helloworld_service2.xml

Or, in any case following command can be useful to export a current config from the Admin. It helps to understand what has to be changed inside the config file (when you are setting up things the first time)…

AppManage -export -app TestServices/helloworld_service -out D:/jenkins/helloworld_service.xml -domain bw5_dev -cred D:\jenkins\cred.txt

Next steps will include

w