Red Hat Training
A Red Hat training course is available for Red Hat JBoss Operations Network
18.8. Deploying Applications to the Group Members: deploy.js
Set up the usage information and the group search as in the other scripts, then use the deployment script described in Chapter 15, Example: Scripting Resource Deployments (JBoss EAP 5).
The script uses two parameters, one for the group name and one for the file to upload.
As one easy improvement, the last part of Section 15.2, “Checking the JBoss ON Groups and Inventory” stops the JBoss server, uploads the content, and restarts it. Instead, simply check that the server is running first, and then upload the content:
// we need check to see if the given server is up and running var avail = AvailabilityManager.getCurrentAvailabilityForResource(server.id); // unfortunately, we can only proceed with deployment if the server is running. Why? if( avail.availabilityType.toString() == "DOWN" ) { println(" Server is DOWN. Please first start the server and run this script again!"); println(""); continue; }