Author |
Message
|
Vanshul_MB |
Posted: Tue Apr 05, 2011 6:02 am Post subject: Build scripts for broker components |
|
|
Acolyte
Joined: 09 Feb 2011 Posts: 68
|
Hi,
we have a requirement from cleint that they need build scripts for flows and message sets.
I created the scripts and asked them to run on a machine where broker is installed.
Now they want it to be executed using ANT from a common directory being used by every project which is comething like /projects/common/build
how can we run the mqsicreatebar command on that path?
Can we do some settings for this?
I tried including
C:\Program Files (x86)\IBM\MQSI\7.0> in my classpath and PATH on windows box and then run the command from simple command prompt but it didnt workd.
Please help me in this. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Tue Apr 05, 2011 6:23 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
1. You should never start your automated builds from an old directory. Always download fresh source code first from the source code repository. Create a brand new directory every time. -cleanbuild option sometimes is not as effective as it needs to be (ie. results in bloated files). That is why you should start from brand new directory every time.
2. You should be using Ant to invoke a single build job.
3. You should be using Hudson, CruiseControl, or BuildForge to invoke Ant.
4. You should be building and deploying BAR files "hands-free". Means no manual manipulation of source code to jigger the thing to work right.
5. You probably a little over your head in this one, ask senior coach or mentor for help. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
rama1977 |
Posted: Tue Apr 05, 2011 6:46 am Post subject: Re: Build scripts for broker components |
|
|
 Newbie
Joined: 22 Mar 2011 Posts: 7
|
Vanshul_MB wrote: |
how can we run the mqsicreatebar command on that path?
Can we do some settings for this?
I tried including
C:\Program Files (x86)\IBM\MQSI\7.0> in my classpath and PATH on windows box and then run the command from simple command prompt but it didnt workd. |
Just adding path does not work. Use mqsiprofile in script to make mqsicreatebar work. |
|
Back to top |
|
 |
Vanshul_MB |
Posted: Tue Apr 05, 2011 6:46 am Post subject: |
|
|
Acolyte
Joined: 09 Feb 2011 Posts: 68
|
Thanks.
Suppose its a new directory not in my workpath
they are getting this error
'mqsicreatebar' is not recognized as an internal or external command,
operable program or batch file.
they tried it from directory create by them.its first time we are building it like this.we were manually doing it till now
Please let me know in case we need to do some settings on server? |
|
Back to top |
|
 |
lancelotlinc |
Posted: Tue Apr 05, 2011 7:04 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
The Hudson/CruiseControl/BuildForge automatic build process user Id should source the mqsiprofile.
If you are trying to do this without Hudson/CruiseControl/BuildForge, the effort is vain. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
Vanshul_MB |
Posted: Tue Apr 05, 2011 7:07 am Post subject: |
|
|
Acolyte
Joined: 09 Feb 2011 Posts: 68
|
Ok.
so we need to follow below steps as per the company policies:
1. create build scripts...so it will be mqsicreatebar etc
2. run these scripts using ANT from a directory which is not broker workpath.
Can we set say C:\temp directory to run the mqsicreatebar with some settings? |
|
Back to top |
|
 |
lancelotlinc |
Posted: Tue Apr 05, 2011 7:20 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
It's nice you want to use Ant, and your company policies think Ant is the solution. Your company policies are not intelligent enough to manage the Ant process. You need an additional tool.
Also, you need to seek out a more senior member of your team that has done WMB Ant scripts before. It seems your questions are not reflecting a good reading of the below article:
http://www.ibm.com/developerworks/websphere/library/techarticles/0706_spriet/0706_spriet.html
If you have read this article, you are missing some key points. Like sourcing the mqsiprofile.
Quote: |
The most common way to build a BAR file from source files is to use an Ant script to extract the source data from a repository... |
If you elect to omit the step of retrieving automatically the source files, then you are stuck with potentially bloated bar files. Use a clean, fresh, new directory every time. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
Vanshul_MB |
Posted: Tue Apr 05, 2011 7:27 am Post subject: |
|
|
Acolyte
Joined: 09 Feb 2011 Posts: 68
|
Sorry to bother u again and again but there are no senior member who can help as we are doing it for first time.
my build.xml is comething like ds
<?xml version="1.0"?>
<project name="project" basedir="." default="run">
<!-- set global properties for this build -->
<property file="Build_EI0012.conf" />
<target name="run" description="">
<antcall target="mqsicreatebar.buildbar" />
<antcall target="mqsiapplybaroverride" />
</target>
<!--
Target to build the broker archive using mqsicreatebar
-->
<target name="mqsicreatebar.buildbar">
<echo message="Building Broker Archive file: ${bar.name} " />
<echo message="*** HK****SourceDir - ${SourceDir} " />
<echo message="***HK****BinariesRoot - ${BuildDirectory}/Sources " />
<echo message="***HK****TestResultsRoot - ${TestResultsRoot} " />
<echo message="***HK****SolutionRoot - ${SolutionRoot} " />
<echo message="***HK****DropLocation - ${DropLocation} " />
<echo message="***HK****Value of common project - ${SolutionRoot}/Common/${projects} " />
<echo message="***Moving common project to Sources folder***** " />
<copy todir="${projects}">
<fileset dir="EI0012\${projects}"/>
</copy>
<mkdir dir="${DropLocation}\${BuildNumber}\Deployables"/>
<exec executable="D:/IBM/WMBT700/mqsicreatebar.exe" failonerror="true">
<arg value="-data" />
<arg value="${basedir}" />
<arg value="-b" />
<arg value="${DropLocation}\${BuildNumber}\Deployables\${bar.name}" />
<arg value="-p" />
<arg value="${projects}" />
<arg value="-o" />
<arg value="${msmf.files1}"/>
</exec>
<echo message="Completed building Broker Archive file - ${bar.name} " />
</target>
<target name="mqsideploybar">
<echo message="Deploying Broker Archive file: ${bar.name} " />
<exec executable="mqsiprofile.cmd"/>
<exec executable="mqsideploy.exe">
<arg value="-i" />
<arg value="${mb.server.host}" />
<arg value="-p" />
<arg value="${mb.qmgr.port}" />
<arg value="-q" />
<arg value="${mb.qmgr}" />
<arg value="-b" />
<arg value="${mb.broker}" />
<arg value="-e" />
<arg value="${mb.executiongrp}"/>
<arg value="-a"/>
<arg value="${mb.bar.file}"/>
<arg value="-m"/>
<arg value="-w"/>
<arg value="${mb.deploy.timeout}"/>
</exec>
<echo message="Completed Deploying Broker Archive file - ${bar.name} " />
</target>
</project>
my build.conf is comething like ds
#WMB tool kit home
toolkit.home="D:/IBM/WMBT700"
ant.bars.basedir="/Program Files/IBM/WMBT700/bin"
workspaces.dir="/Documents and Settings/z062012/IBM/wmbt70/workspace"
bar.name=Barname.bar
projects=EI0012_ACCOR_HotelContent_Flow
msmf.files="EI0012_ACCOR_HotelContent_Flow/EI0012_ACCOR_HotelContent_WS.msgflow"
Now, i know we can run this from broker workpath location.
how to run it using some other locationa and ANT.
Its stupid to ask but can i get the command say running this fil using ANT from C:\temp(where these build files are already present in this directory) |
|
Back to top |
|
 |
lancelotlinc |
Posted: Tue Apr 05, 2011 7:32 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
|