wldeploy on all files in deployment folder

2019-09-14 01:55发布

问题:

I am trying to automate my web logic deployment for my local dev environment. I currently an using a master ant build file that compiles ~60 projects and copies the related ear,war, jar files to a deployment folder off of the root. Right now we install these one by one vie the wl console. I am trying to automate this using wldeploy in the master build file. I would like to be able to feed this task a list of files to deploy sequentially. Ant-contrib has something similar but it appears to have very little activity which makes me nervous. Plus I would prefer to use native ant functionality if possible.

Is there an option native to ant? Would I be better-off scripting something to call web logic.deployer? Is there another option I am not yet aware of?

回答1:

The best option would be WLST. Try below after connecting to your admin server.

    app-list = [app1 app2 app3 ... app60]
    for app in app-list:
        edit()
        startEdit()
        app-path = "<path-to-your-apps>/"+app1
        deploy(app,app-path,targets=<your-targets>)
        print 'deployed '+app
        activate()

Make use of the document http://docs.oracle.com/cloud/latest/fmw122100/WLSTC/reference.htm#WLSTC202

Please keep this thread updated for any issues.

You can also make use of python OS module to pick the app list dynamically.