Having a go with the scripting interface to WebSphere Application Server is one of those tasks that has been "on my list" for a long time. Last week I had a need to create a simple script to silently install a JEE application as part of an IWD script package.
Here's a small piece of Jython that I came up with:
# import os module so we can get environment variables
contextRoot = '/myapp'
appName = 'myApp'
# get IWD environment variables CELL_NAME and NODE_NAME, or fall back to sensible defaults
cell = os.getenv('CELL_NAME')
cell = 'CloudBurstCell_1'
node = os.getenv('NODE_NAME')
node = 'CloudBurstNode_1'
# install the application, then save the configuration
AdminApp.install('/path/to/myApp.war', ['-contextroot', contextRoot, '-appname', appName, '-MapWebModToVH', '[[".*", ".*", "default_host"]]'])
# get the ApplicationManager object and use it to start the application
appMan = AdminControl.queryNames('cell='+cell+',node='+node+',type=ApplicationManager,process=server1,*')
AdminControl.invoke(appMan, 'startApplication', appName)
Assuming you saved the script into a file called installApp.jy, you would execute it from the command line using wsadmin as follows:
<WAS_PROFILE_ROOT>/wsadmin.sh -lang jython -f <path_to>/installApp.jy
The script will only work for a standalone application server in it's current state, but hopefully it will help you out and provide a good starting point for installing to a cluster.