<?xml version="1.0"?>
<project name="project" default="run">
<target name="run" description="">
<antcall target="mqsicreatebar.buildbar" />
<antcall target="mqsideploy.deploybar" />
</target>
<!-- Target to build the broker archive using mqsicreatebar -->
<target name="mqsicreatebar.buildbar">
<property name="toolkit.home" value="C:\Program Files\IBM\WMBT700" />
<property name="workspaces.dir" value="C:\Harish\AntProject" />
<property name="bar.name" value="C:\ABC\sample.bar" />
<exec executable="${toolkit.home}\mqsicreatebar.exe" spawn="false">
<arg value="-data" />
<arg value="${workspaces.dir}" />
<arg value="-b" />
<arg value="${bar.name}" />
<arg value="-cleanBuild" />
<arg value="-p" />
<arg value="MyProject" />
<arg value="-o" />
<arg value="MyProject\Sample.msgflow" />
</exec>
<echo message="Completed building Broker Archive file - ${bar.name} " />
</target>
<!-- Target to deploy the broker archive using mqsideployscript -->
<target name="mqsideploy.deploybar">
<property name="mqsi.home" value="C:\Program Files\IBM\MQSI\7.0\bin" />
<property name="bar.name" value="C:\ABC\sample.bar" />
<property name="broker" value="ECSBRK" />
<property name="exegroup" value="default" />
<exec executable="${mqsi.home}\mymqsideployscript.bat" spawn="false">
<arg value="${broker}" />
<arg value="-e" />
<arg value="${exegroup}" />
<arg value="-a" />
<arg value="${bar.name}" />
</exec>
<echo message="Deployed Broker Archive file - ${bar.name} " />
</target>
</project>
I have modified mqsideployscript.bat to mymqsideployscript.bat in the above script because we should call mqsiprofile.cmd before calling mqsideployscript.bat, but the constraint is, it should happen in a single exec call because each instance of exec in Ant removes the previous call to profile. We have to source the profile before invoking Ant, or the command will fail.
Whereas mymqsideployscript.bat is
@echo off
setlocal
CALL C:\Progra~1\IBM\MQSI\7.0\bin\mqsiprofile.cmd
set PRODUCT_PATH=%~dp0..
if %1""=="" goto noparam
SET parm8=%8
SET parm9=%9
SHIFT /8
SET parm10=%9
SHIFT /8
SET parm11=%9
SHIFT /8
SET parm12=%9
SHIFT /8
SET parm13=%9
SHIFT /8
SET parm14=%9
SHIFT /8
SET parm15=%9
SHIFT /8
SET parm16=%9
SHIFT /8
SET parm17=%9
SHIFT /8
SET parm18=%9
SHIFT /8
SET parm19=%9
SHIFT /8
SET parm20=%9
"%MQSI_JREPATH%\bin\java" com.ibm.broker.config.util.Deploy %1 %2 %3 %4 %5 %6 %7 %parm8% %parm9% %parm10% %parm11% %parm12% %parm13% %parm14% %parm15% %parm16% %parm17% %parm18% %parm19% %parm20%
goto end
:noparam
"%MQSI_JREPATH%\bin\java" com.ibm.broker.config.util.Deploy -?
:end
endlocal
For more info :
http://www.mqseries.net/phpBB2/viewtopic.php?t=55006&postdays=0&postorder=asc&start=0&sid=ec6794b648a9cd71c59574cb7dc32209
In mqsideploy.deploybar,
ReplyDeletemodify bar to bar.name to suffice the purpose
I am using Broker version 7 and I followed everything that was specified in this blog but not able to make it work. I am new to broker. I could not find mqsideployscript.bat or mqsideploy.bat in my floder structure any where. I installed broker version 7 on windows 64bit OS. So, I just copied what was given in this blog and created "mymqsideployscript.bat" at "C:\Program Files (x86)\IBM\MQSI\7.0\bin" with same lines except CALL cmd is diff which is "CALL "C:\Program Files (x86)\IBM\MQSI\7.0\bin\mqsiprofile.cmd"". I am getting exception when I execute following command at the cmd promp.
ReplyDeleteC:\Program Files (x86)\IBM\MQSI\7.0\bin>mymqsideployscript.bat -b LocalBroker -e default -a C:\Temp\AntBarFiles\EmployeeInfoToKronos.bar -w 430
Exception is :
MQSI 7.0.0.0
C:\Program Files (x86)\IBM\MQSI\7.0
BIP1033E: Invalid parameters.
The following flag(s) are invalid, missing, or cannot be used together: '-a'.
Reissue the command specifying valid options and flags.
BIP1032S: The message could not be found in resource bundle BIPmsgs. Inserts: {
1} {2} {3} {4} {5}
-----------------
Am I doing anything wrong?
here is my file content :
@echo off
setlocal
CALL "C:\Program Files (x86)\IBM\MQSI\7.0\bin\mqsiprofile.cmd"
set PRODUCT_PATH=%~dp0..
if %1""=="" goto noparam
SET parm8=%8
SET parm9=%9
SHIFT /8
SET parm10=%9
SHIFT /8
SET parm11=%9
SHIFT /8
SET parm12=%9
SHIFT /8
SET parm13=%9
SHIFT /8
SET parm14=%9
SHIFT /8
SET parm15=%9
SHIFT /8
SET parm16=%9
SHIFT /8
SET parm17=%9
SHIFT /8
SET parm18=%9
SHIFT /8
SET parm19=%9
SHIFT /8
SET parm20=%9
"%MQSI_JREPATH%\bin\java" com.ibm.broker.config.util.Deploy %1 %2 %3 %4 %5 %6 %7 %parm8% %parm9% %parm10% %parm11% %parm12% %parm13% %parm14% %parm15% %parm16% %parm17% %parm18% %parm19% %parm20%
goto end
:noparam
"%MQSI_JREPATH%\bin\java" com.ibm.broker.config.util.Deploy -?
:end
endlocal
Note that with Broker v8 you don't need to call mqsiprofile.cmd. The mqsideployscript calls it.
ReplyDeleteIf you are using Windows 64 bit OS, then add this line CALL C:\Progra~2\IBM\MQSI\7.0\bin\mqsiprofile.cmd instead of this CALL "C:\Program Files (x86)\IBM\MQSI\7.0\bin\mqsiprofile.cmd" for MB 7.0.0.1
Delete