Application Deployment¶
Enhanced mule tools can be used to deploy an application that is built from source code, or a pre-compiled application jar.
Deployment methods¶
Deploy from sources¶
To use enhanced mule tools in a maven project, add the following plugin to your pom.xml:
<build>
<plugins>
...
<plugin>
<groupId>com.aeontronix.enhanced-mule</groupId>
<version>1.4.62</version>
<artifactId>enhanced-mule-tools-maven-plugin</artifactId>
<executions>
<execution>
<id>deploy</id>
<goals>
<goal>prepare-deploy</goal>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
...
</plugins>
</build>
Also you'll want to disable the standard maven deployment, which can be done by using the maven.deploy.skip
property:
See maven reference docs for details on available goals and parameters
Deploy pre-built binary¶
To deploy a pre-compile jar file ( myapplication.jar in the following example ), use the following maven command:
mvn com.aeontronix.enhanced-mule:enhanced-mule-tools-maven-plugin:1.4.62:deploy -Dfile=myapplication.jar
Exchange-based release management¶
In order to deploy application using an exchange-based release management, see Exchange-Based Release Management for details.
Runtime Deployment Configuration¶
Deployment configuration¶
While runtime deployment configurations can be specified as parameters during deployment, EMT provides a much better approach by enabling the definition of those configurations in anypoint.json
For example to specify default deployment configurations for cloudhub, the following can be added to anypoint.json
{
"$schema": "https://docs.enhanced-mule.com/schemas/emule-application-1.0.schema.json",
"deploymentParams": {
"autoApproveAccess": "true",
"cloudhub": {
"workerType": "micro",
"workerCount": 1,
"region": "us-east-1",
"customlog4j": true
}
}
}
Full available configuration elements (for cloudhub, on-prem and RTF) can be found in the application descriptor schema
Additionally, it is possible to specify overrides for specific environments or environment types.
For example to use 2 workers and a large instance in cloudhub when deployed in prod
environment:
{
"$schema": "https://docs.enhanced-mule.com/schemas/emule-application-1.0.schema.json",
"deploymentParams": {
"autoApproveAccess": "true",
"cloudhub": {
"workerType": "micro",
"workerCount": 1,
"region": "us-east-1",
"customlog4j": true
}
},
"overrides": [
{
"type": "env",
"value": "prod",
"override": {
"deploymentParams": {
"cloudhub": {
"workerType": "large",
"workerCount": 2
}
}
}
}
]
}
Deployment overrides ( Maven )¶
It is possible to override any of the deploymentParams values when using the Maven deploy goal, by specifying maven properties starting with 'emt.deploy.override.[deploy-property]'.
For example, if you want to override the cloudhub worker count, you can use the
property emt.deploy.override.cloudhub.workerCount