Is it possible to redeploy app on remote weblogic without restarting server?

1.4k views Asked by At

I have weblogic 12.4.2 running inside Linux and my development environment is in Windows. Currently, if I want to redeploy the app, I do maven clean install and login in to Linux with ssh client, kill process of weblogic, copy my jar files into domain's directory, and run weblogic again. I want a tool that copy's jar files in to appropriate location in the server and redeploys the app without need to restart weblogic and preferably does not depend on IDEs.

I found weblogic hot deploy, and fast swap to redeploy app on weblogic without restarting. And the weblogic.Deployer, Admin Console, wldeploy Ant Task , WebLogic Scripting Tool and weblogic maven plugin to deploy app on weblogic remotely. I searched about them but I'm not sure that which of them can do all these things together and what are their advantages and disadvantages.

If possible, please give comparison of existing tools. I saw similar questions but they only focused on redeploying without restarting or deploying remotely and I want both.

1

There are 1 answers

7
jaguililla On

Yes, you can use the management REST API.

Here you can check specific examples on how to deploy/redeploy applications.

This REST API give you tools to deploy applications (EAR and WAR files) and start/stop them using only the curl tool. Check some examples:

# Stops a deployed application
curl -v --user ${USER}:${PASS} \
 -H X-Requested-By:MyClient \
 -H Accept:application/json \
 -H Content-Type:application/json \
 -X POST http://localhost:7001/management/weblogic/latest/domainRuntime/deploymentManager/appDeploymentRuntimes/${APP_NAME}/stop

# Deploy an application from a file
curl -v --user ${USER}:${PASS} \
 -H X-Requested-By:MyClient \
 -H Accept:application/json \
 -H Content-Type:multipart/form-data \
 -F "model={
   name:    'basicapp',
   targets: [ { identity: [ 'clusters' , 'Cluster1' ] } ]
 }" \
 -F "sourcePath=@/deployments/BasicApp/app/BasicApp.ear" \
 -F "planPath=@/deployments/BasicApp/plan/Plan.xml" \
 -H "Prefer:respond-async" \
 -X POST http://localhost:7001/management/weblogic/latest/edit/appDeployments

You can use shell aliases and shell scripts to automate certain operations.