当前位置: 代码迷 >> Web前端 >> 经过脚本部署WebSphere 应用
  详细解决方案

经过脚本部署WebSphere 应用

热度:277   发布时间:2012-11-15 15:16:14.0
通过脚本部署WebSphere 应用
启动脚本
@echo off

:START

SET path=D:\IBM\WebSphere\AppServer\bin;%path%

SET WAS_BIN="D:\IBM\WebSphere\AppServer\bin"

call %WAS_BIN%\setupCmdline.bat

wsadmin -conntype SOAP -host 192.168.127.13 -port 8879  -f wasdeploy.jacl

goto END

:ERROR

echo syntax error, the correct syntax is:
echo wsadm  [server name]  
pause

:END



wsadmin脚本
set appName YBT
set serverName Banca
set nodeName CHODLYBT02Node01
set cellName CHODLYBT02Cell01
set baseDir D:/Applications/NewYBT
set fileName ybt.ear

puts "Please input directory name:"
gets stdin dir

set earFile "$baseDir/$dir/$fileName"



# echo ear file 
puts "### INFO:Processed application EAR file is: $earFile"


# check if the EAR file exists
set result [file exists $earFile]

if {$result == 1} {
	#check if the server is start
	set serverStatus [$AdminControl completeObjectName name=$serverName,type=Server,node=$nodeName,*]
	#stop the server if it has been started
	if {$serverStatus != ""} {
		puts "### INFO:process will stop the server named $serverName first..."
		$AdminControl stopServer $serverName $nodeName immediate
		puts "### INFO:stop server $serverName complated"
	} 
	
		
	#install new application
	puts "### INFO:begining update the application..."
	set param "-appname $appName -cell $cellName -node $nodeName -update -update.ignore.new"
	$AdminApp install $earFile $param 
	puts "### INFO:application update complated"
	
	
	#save configuration
	puts "### INFO:begining save configuration ..."
	$AdminConfig save
	puts "### INFO:Configuration saved"
	
	
	#Synchronize changes with Nodes
	puts "### INFO:begining synchronize changes with nodes..."
	set Sync1 [$AdminControl completeObjectName type=NodeSync,node=$nodeName,*]
	$AdminControl invoke $Sync1 sync		
	puts "### INFO:Nodes synchronized "		
			
	#start server
	puts "### INFO:start server named $serverName..."
	$AdminControl startServer $serverName $nodeName 
	puts "### INFO:Server started"
	
	puts "### Application deploy successfully ###"
	
} else {
	puts "### ERROR: ### $earFile is not exist"
}

puts "Press any key to exit!"
gets stdin exitStr