ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » mqsideploy using ANT

Post new topic  Reply to topic Goto page 1, 2  Next
 mqsideploy using ANT « View previous topic :: View next topic » 
Author Message
kash3338
PostPosted: Wed Jan 25, 2012 5:52 am    Post subject: mqsideploy using ANT Reply with quote

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
View user's profile Send private message Send e-mail
lancelotlinc
PostPosted: Wed Jan 25, 2012 5:54 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

You source the mqsiprofile in the command shell before invoking Ant. Pretty simple, isn't it?
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
kash3338
PostPosted: Wed Jan 25, 2012 6:04 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
lancelotlinc
PostPosted: Wed Jan 25, 2012 6:45 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Jan 25, 2012 7:23 am    Post subject: Reply with quote

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
View user's profile Send private message
lancelotlinc
PostPosted: Wed Jan 25, 2012 8:36 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
kash3338
PostPosted: Wed Jan 25, 2012 9:08 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Jan 25, 2012 9:16 am    Post subject: Reply with quote

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
View user's profile Send private message
lancelotlinc
PostPosted: Wed Jan 25, 2012 10:09 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Jan 25, 2012 10:13 am    Post subject: Reply with quote

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
View user's profile Send private message
kash3338
PostPosted: Thu Jan 26, 2012 9:40 am    Post subject: Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

Thanks mqjeff for your ideas. Also your recent post on "arguing with Ant"
http://www.mqseries.net/phpBB2/viewtopic.php?t=60150
is also very useful onw

@ lancelotlinc:

I would like to know how you had implemented the work around for your earlier similar question on mqsideploy using ANT. Below link was your earlier question on similar grounds,
http://www.mqseries.net/phpBB2/viewtopic.php?t=58074&sid=97653e0cfb97086d016ca06854fecd3e
Back to top
View user's profile Send private message Send e-mail
lancelotlinc
PostPosted: Thu Jan 26, 2012 9:57 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
ghoshly
PostPosted: Tue Jul 01, 2014 6:49 am    Post subject: Trying through Ant Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Tue Jul 01, 2014 6:34 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Jul 02, 2014 5:28 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » mqsideploy using ANT
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.