This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes deploy remotely using ANT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "deploy remotely using ANT" Watch "deploy remotely using ANT" New topic
Author

deploy remotely using ANT

Daoyue Ming
Greenhorn

Joined: Oct 04, 2004
Posts: 26
I have written an ant script to ftp an ear file to a remote server, and use telnet task to login and undeploy previous version, then deploy current version.

However our remote weblogic server is not stable, sometimes it doesn't respond when I try to deploy, or previous version deployed has a deploy name my script not expected.

Question:
1. how to see list of ear file deployed in weblogic so that I will know which one to undeploy before I deploy my ear file.
2. if I try to deploy, and the server doesn't respond, is there any way to send a failed notification email?
3. if the output for telnet is not expected, how to handle it? so far the sequence of the commands must follow the sequence specified in the script, so if anything not expected happen, the script will fail.
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
You may want to take a look at WebLogicServer Scripting Tool (wlst). It may help with the dynamic stuff you asked about (check for which ear to work with)

In the zip on this wlst download page, there's a pdf and a powerpoint presentation. Note that there are various downloads on the codeshare wlst site, the pointer is to the online download (work with a running server).

Clips from the powerpoint:


WLST � powerful automation for administrators
Based on an open, active language (Jython)
Easy to learn and use, yet powerful
Supported by BEA as of Diablo, but available today!
(works with 7.0 & 8.1, all SPs, and will work with Diablo)

Manage & configure WebLogic Server (online/offline)
Built on Jython
100% pure Java Implementation of Python
Simple & clear syntax
Use existing java classes from within jython
Proven to be Fast & Reliable compared to others
Includes capabilities of
weblogic.Admin
weblogic.Deployer
wlconfig Ant Tasks
config wizard(silent mode)


Interactive
Navigation/Interrogation
Prototyping command syntax
Record Interactions to a script to play it later

Script
Sequence of commands via file
Use loops, flow control, conditional statements, variables
Embedded
weblogic.management.scripting.utils.WLSTInterpreter
Able to Call WLST interpreter from within your Java code
Interrogate/Navigate to Resources
Easily move resources from one Domain to another
Use WLST in conjunction with any java utility tools
Navigation is loosely based on File Notation in OS
config, runtime & custom - Drives
MBean Types/Instances � Directories
Attributes/Operations � Files



Is there some reason the deploy step can't be done from your local server? It may be easier to see what happened if it's not part of a telnet.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15961
    
  19

Have you looked at the ServerDeploy optional Ant task? It uses the JSR-88 standard to deploy EARs, WARs, JARs, etc to a server.


Customer surveys are for companies who didn't pay proper attention to begin with.
Daoyue Ming
Greenhorn

Joined: Oct 04, 2004
Posts: 26
the reason why I need to put the ear file in the server side is for distribution in centre server, so everyone can get it.

The main problem is to know the application name deployed, for example, I can use -listapps option from weblogic.Deployer, but however it will list all the applications deployed, how do I grep the name I needed to undeploy based on the application name. Can ant or jelly do it?

Anyone playing mud using tintin++ or similar tools? It can use trigger to assign expected patterns to some variables, can I do it in Java environment?
Daoyue Ming
Greenhorn

Joined: Oct 04, 2004
Posts: 26
never use jython before, but checking how to do it, thanks, Enderlin!
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15961
    
  19

Originally posted by Daoyue Ming:
the reason why I need to put the ear file in the server side is for distribution in centre server, so everyone can get it.

The main problem is to know the application name deployed, for example, I can use -listapps option from weblogic.Deployer, but however it will list all the applications deployed, how do I grep the name I needed to undeploy based on the application name. Can ant or jelly do it?

Anyone playing mud using tintin++ or similar tools? It can use trigger to assign expected patterns to some variables, can I do it in Java environment?


JSR-88 allows installing the same WAR/EAR onto a server as multiple instances with names - which is what it sounds like you're asking about.

The JSR-88 API permits enumerating these instances, though I don't think the Ant deploy task supports that. You could always write your own JSR-88-based Ant task or app.
 
Consider Paul's rocket mass heater.
 
subject: deploy remotely using ANT
 
Similar Threads
Netbeans IDE for Part II preperation
Running WebLogic sh script that sets environment variables from ANT
start/stop Sun Application server from ant build.xml
ant display message...
HELP - Non-Java programmer