I am trying to use variables in install script in wsadmin on jacl. First I am specifying
set nodeName [$AdminControl getNode]
set cellName [$AdminControl getCell]
Then in my script I want to use these 2 variables but for some reason it done want to take them
$AdminApp install C:/ssc.war { -nopreCompileJSPs -installed.ear.destination $(APP_INSTALL_ROOT)/$(CELL) -distributeApp -nouseMetaDataFromBinary -nodeployejb -appname ssc_war -createMBeansForResources -noreloadEnabled -nodeployws -validateinstall warn -noprocessEmbeddedConfig -filepermission .*\.dll=755#.*\.so=755#.*\.a=755#.*\.sl=755 -noallowDispatchRemoteInclude -noallowServiceRemoteInclude -asyncRequestDispatchType DISABLED -nouseAutoLink -noenableClientModule -clientMode isolated -novalidateSchema -contextroot /ssc -MapModulesToServers {{"F" ssc.war,WEB-INF/web.xml WebSphere:cell=$**cellName**,node=$**nodeName**,server=server1}} -MapWebModToVH {{"Fortify Portal" ssc.war,WEB-INF/web.xml default_host}} -CtxRootForWebMod {{"Fortify Portal" ssc.war,WEB-INF/web.xml /ssc}}}
Probably something wrong with the syntax
In the initial script you provided, I don't see any attempt to use the variables nodeName
or cellName
. Also, do you actually care about supplying all of those arguments? Most of them are defaults. Also, you're not putting quotes " around the .war path, which is required.
To use a variable in a wsadmin script, put a $
sign in front of the variable name. Such as:
set myvar "test"
puts $myvar
So, to install an app, it should be as simple as:
set cellName [$AdminControl getCell]
set nodeName [$AdminControl getNode]
set serverName [$AdminControl getServer]
$AdminApp install "C:/ssc.war" {
-node $nodeName
-cell $cellName
-server $serverName
}
I'd recommend taking a look at the IBM doc for WebSphere scripting, it describes what you're trying to do: Installing enterprise applications using wsadmin scripting
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.