Introduction
Once you have runtime environment setup on-premise, you want to be able to deploy & undeploy mule apps. Let’s find out how easily can this be done and appreciate the beauty behind its simplicity.
Environment
Environment used was as following
Source Code
You can find the source code of this project from here
Export app
Mule Developer is supposed to give the app packaged in a deployable archive to Mule Administrator. Mule Developer can do this straight from Anypoint studio.
Start mule specifying placeholder value
This project is based off from the environment aware project template. Therefore, you will need to pass expected placeholder value when running mule runtime.
There are vairous ways to do so, but the simplest would be passing as a parameter when running mule from a command line.
C:\mule\onprem_servers\max\bin>mule -M-Dmule.env=Development
Make sure the placeholder value was fed as expected
********************************************************************** * Mule Runtime and Integration Platform * * Version: 3.8.5 Build: de4fbf1e * * MuleSoft, Inc. * * For more information go to * * http://www.mulesoft.com/mule-esb-enterprise * * * * Server started: 18/08/17 1:37 PM * * JDK: 1.8.0_141 (mixed mode) * * OS: Windows 10 - (10.0, amd64) * * Mule system properties: * * - mule.base = C:\mule\onprem_servers\max * * - mule.env = Development * * - mule.home = C:\mule\onprem_servers\max * **********************************************************************
Deploy app
The deployable archive has everything necessary from within. Thus, app deployment is as easy as putting this into apps folder of mule runtime.
Once the deployment is successful, you will see the deployable archive file was consumed and created an anchor file.
{YourAppName}-anchor.txt
Undeploy app
Undeploying the app is done by removing the anchor file created after deployment above. Let’s see how it’s done.
Summary
You have now seen how easy it is to deploy and undeploy app from customer-hosted runtime. I reckon the beauty behind this simplicity is remarkable. There is no mess around with setup file, touching windows registry, deploying artifacts into dependent proprietary database, etc. All it takes is creating a self-contained zip file and it has everything necessary to run the app within. It is simple, light-weight, independent and manageable. I hope everyone see the beauty.