Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # let's say the appName is testApp
- # can move all of these properties to a props file
- appName='testApp'
- appPath='/scratch/user/testApp.war'
- appTarget='AdminServer'
- username='weblogic'
- password='weblogic1'
- adminURL='t3://hostname:adminport'
- # start deploy/undeploy code
- connect (username, password, adminURL)
- for app in cmo.getAppDeployments():
- currAppName = app.getName()
- if currAppName == appName :
- print('Application' + appName + ' already exists, undeploying...')
- undeploy(appName)
- # sleep is just to make sure that we don't attempt deploy immediately i.e before server is finished with undeploying
- # more like a safe side one, may not be required also
- java.lang.Thread.sleep(60000)
- print('Now deploying ' + appName)
- deploy(appName, appPath, appTarget)
- disconnect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement