废话少说 直接上代码
1 import re
2
3 warPath = 'helloWebApp'
4 serverUrl = 't3://192.168.1.100:7001'
5 username = 'weblogic'
6 password = 'weblogic'
7 targetServer="examplesServer"
8 deployAppName='DeployExample2'
9
10
11 connect(username, password, serverUrl)
12
13 appList = re.findall(deployAppName, ls('/AppDeployments'))
14 print "========================="
15 print len(appList)
16 if len(appList) > 0:
17 #oldestArchiveVersion = min(map(int, appList))
18 print 'come in!!!'
19 undeploy(deployAppName)
20
21 #deploy(appName='DeployExample', path = 'helloWebApp', targets = 'examplesServer',timeout=600000, block = 'true')
22
23 deploy(deployAppName, warPath, targets=targetServer, securityModel = "Advanced",timeout=600000, block = "true")
24 exit()
Ok