通过脚本部署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


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值