Monday, July 27, 2015

Continuous build on Message Flow with Jenkin 3

Since the build was so successful on last time. My colleague, Ming Kuan, doesn't want to let Jenkins stops. He is pushing Jenkins to next level – deploy to Message Broker after the build. Not much information could be found on the Internet for this issue. But he was successfully implemented it on Jenkins. He is a ranger, warrior, a real fighter among the team member. What he did was he created a BATCH script for the deployment job and then this BATCH script was triggered from ANT script.

This is the ingredient for ANT, its job only to trigger BATCH:
< target name="deploy">
   <exec executable="cmd">
      <arg value="/c"/>
      <arg value="${deploy_file_path}/deploy.bat"/>
      <arg value="${bar_file}.bar"/>

This is the ingredient for BATCH:
call "C:/Program Files/IBM/MQSI/"

SET EXE_PATH="C:/Program Files/IBM/MQSI/*;C:/Program Files (x86)/IBM/WebSphere MQ/java/lib/*"

SET PATH=%PATH%;C:/Program Files/IBM/MQSI/;C:/Program Files/IBM/MQSI/;


java -cp %EXE_PATH% -i -p 1818 -q Q1 -e E1 -a %BAR_FILE% -w 600

java -cp %EXE_PATH% -stop -i -p 1818 -q Q1 -e E1

java -cp %EXE_PATH% -start -i -p 1818 -q Q1 -e E1

*Alert! Notice there is a path, C:/Program Files/IBM/MQSI/, being pre-code in the BATCH. This path contains various raw materials to feed the deployment process. Thus, make sure WebSphere MQ was installed on the system. If it doesn’t, C:/Program Files/IBM/MQSI/ will never exist on the system.

The is just like the regular mqsideploy command use in ours daily job for deployment purpose. And is just like mqsistartmsgflow and mqsistopmsgflow use to restart the execution group. The reason for this is to make sure the deployment will take effect immediately after deployment.

Nice work from our warrior, Ming Kuan.

Keep on building, Jenkins!

No comments: