Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. # let's say the appName is testApp
  2. # can move all of these properties to a props file
  3. appName='testApp'
  4. appPath='/scratch/user/testApp.war'
  5. appTarget='AdminServer'
  6. username='weblogic'
  7. password='weblogic1'
  8. adminURL='t3://hostname:adminport'
  9.  
  10. # start deploy/undeploy code
  11. connect (username, password, adminURL)
  12. for app in cmo.getAppDeployments():
  13. currAppName = app.getName()
  14. if currAppName == appName :
  15. print('Application' + appName + ' already exists, undeploying...')
  16. undeploy(appName)
  17. # sleep is just to make sure that we don't attempt deploy immediately i.e before server is finished with undeploying
  18. # more like a safe side one, may not be required also
  19. java.lang.Thread.sleep(60000)
  20. print('Now deploying ' + appName)
  21. deploy(appName, appPath, appTarget)
  22. disconnect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement