Author |
Message
|
kash3338 |
Posted: Wed Jan 25, 2012 5:52 am Post subject: mqsideploy using ANT |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
Hi,
I am trying to create a ANT script to create and deploy a BAR file using mqsicreatebar and mqsideploy commands. I am able to create the BAR file, but when i try running the ANT for mqsideploy I face a issue.
Before I run this mqsideploy, it seems I should run the mqsiprofile first. Why should this be done?
Also, when I try to include mqsiprofile and mqsideploy in two exec commands in my ANT script, the problem is, each of this exec runs as a separte shell command and hence when it runs the mqsideploy it throws an error "The user environment was not adequately prepared to continue execution. Locate and run the profile supplied with the product. This file is called mqsiprofile, and is located in the bin subdirectory for the product."
How do I couple these two in my ANT script? I DO NOT WANT to use a batch file here. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Wed Jan 25, 2012 5:54 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
kash3338 |
Posted: Wed Jan 25, 2012 6:04 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
lancelotlinc wrote: |
You source the mqsiprofile in the command shell before invoking Ant. Pretty simple, isn't it? |
Yes its pretty simple when I try to run the ANT script directly form my prompt .
But I am trying to link this ANT script with my Hudson Job where in the Hudson Job invokes this ANT script, how do I run the mqsiprofile then? |
|
Back to top |
|
 |
lancelotlinc |
Posted: Wed Jan 25, 2012 6:45 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
The service Id that Hudson runs under needs to source the mqsiprofile at start time of the session. If on unix, you can do this in the .profile file of the Hudson user's logon directory. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jan 25, 2012 7:23 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You configure Hudsen to run the JVM hosting the ant process inside a command shell that has already had the mqsiprofile applied.
Or you configure your ant script such that all tasks that call mqsi* commands that require the mqsiprofile set (only *runtime* commands need the mqsiprofile set!), will make sure to call those mqsi* commands in a shell that has the mqsiprofile set.
Simple!
And there's tons of previous discussion. Happy Searching! |
|
Back to top |
|
 |
lancelotlinc |
Posted: Wed Jan 25, 2012 8:36 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Congratulations Kash, by the way, on taking the most important step towards Continuous Integration. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
kash3338 |
Posted: Wed Jan 25, 2012 9:08 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
lancelotlinc wrote: |
Congratulations Kash, by the way, on taking the most important step towards Continuous Integration. |
Thanks for that
lancelotlinc wrote: |
The service Id that Hudson runs under needs to source the mqsiprofile at start time of the session. If on unix, you can do this in the .profile file of the Hudson user's logon directory. |
How do I do this in Windows?
mqjeff wrote: |
Or you configure your ant script such that all tasks that call mqsi* commands that require the mqsiprofile set (only *runtime* commands need the mqsiprofile set!), will make sure to call those mqsi* commands in a shell that has the mqsiprofile set. |
I guess this was my question initially How do I make this work in my ANT? And when I browsed, few options I saw was about creating a batch file and calling that in my ANT, which I do not prefer any day.
Also, I would like to know which this mqsiprofile is linked with few set of mqsi* commands? Why this dependency and what is the easiest way to get out this problem when trying to implement Hudson. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jan 25, 2012 9:16 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
kash3338 wrote: |
How do I do this in Windows? |
kash3338 wrote: |
creating a batch file and calling that in my ANT |
I haven't found a more concise way.
Or make sure that you start the Hudson process itself in a shell that has sourced mqsiprofile. I don't know how to do that, however, as I don't know how to start Hudspn. I've never installed or configured the thing.
But this is the less useful solution, as it means that everything that Hudson launches will be in a shell that has mqsiprofile applied. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Wed Jan 25, 2012 10:09 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Again, the process is the same for Windows as for Unix: the service Id running Hudson must source the mqsiprofile. In Windows, this can be done at login just like Unix. Consult your Windows desktop expert for instructions. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jan 25, 2012 10:13 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
lancelotlinc wrote: |
Again, the process is the same for Windows as for Unix: the service Id running Hudson must source the mqsiprofile. |
No, that's one solution.
The other solution is to configure the relevant hudson tasks to either include an inline call to mqsiprofile (which is easy to do on Unix using the ; to run more than one command in the same ant exec task) or to call a script file that sources the mqsiprofile and then calls the relevant command (which is the only way to do this that works on Windows).
I.e. one can either source the profile in the shell that runs Hudson, or one can alter one's exec targets to include mqsiprofile in some manner. |
|
Back to top |
|
 |
kash3338 |
Posted: Thu Jan 26, 2012 9:40 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
|
Back to top |
|
 |
lancelotlinc |
Posted: Thu Jan 26, 2012 9:57 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
We determined that we did not want to deploy through the toolkit interface and wanted the deploy to occur through BuildForge.
The bars to deploy are moved to the local system and a BuildForge script is run, which sources the mqsiprofile or emulates the appropriate mqsiprofile environment variables inside the BuildForge script.
Therefore, an Ant script was written, which is driven by properties file, that can be invoked manually or through BuildForge. If manually, then a prerequisite is to sudo to the Broker's service Id which sources the mqsiprofile before invoking the Ant script. Note that it is imperative that the Broker's service Id be something other than mqm. We run on AIX. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
ghoshly |
Posted: Tue Jul 01, 2014 6:49 am Post subject: Trying through Ant |
|
|
Partisan
Joined: 10 Jan 2008 Posts: 333
|
I am trying mqsipackagebar through Ant in WMB 8.0.0.2 currently in Windows
I am trying to load mqsiprofile through task as mentioned below.
Code: |
<exec executable="${mqsi.home}\mqsiprofile.cmd" spawn="false" /> |
Even though its showing the output, still I am getting usual mqsiprofile loading issue.
Can someone correct me if the syntax is not correct?
I know, I can source mqsiprofile before calling Ant, and even if I do the same, the above syntax is showing duplicate profile loading is restricted. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jul 01, 2014 6:34 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
That may be because your ant script is just calling mqsiprofile and not SOURCING it.
Talk to your friendly unix admin to understand the difference.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jul 02, 2014 5:28 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
fjb_saper wrote: |
That may be because your ant script is just calling mqsiprofile and not SOURCING it.
Talk to your friendly unix admin to understand the difference.
Have fun  |
No, it's because every ant EXEC task runs in a separate shell. |
|
Back to top |
|
 |
|