Automating deployments with Ant tasks
To deploy RuleApps to Rule Execution Server, automate managerial tasks within Decision Center, and run many of the samples, you must have Ant installed on your computer. IBM ODM comes with Ant in the <InstallDir>/shared/tools/ant path. In this tutorial I will show how to use Ant tasks to automate RuleApp management tasks, including reading a specified RuleApp archive from the RES console, create a well-formed RuleApp archive with all its mandatory execution resources and deploy a RuleApp archive to a running Rule Execution Server instance.
Steps:
First of all we need to set up our environment to automate processes, please follow the steps in this link.
- Downloading RuleApp instances from RES
- Create an Ant Build file, you can this directly in your Rule project in Eclipse:
- Define your project and property variables values.
- Tip: You can define properties for your common values like hostname, destfile, userid and password.
- Please find the next sample as a demonstration of a working Ant build file:
- The target res-fetch command extracts a specific Ruleapp value, the res-fetch-all will generate a .war file with all the Ruleapps present in the RES
- Deploying into RES with Ant Tasks
- Now that we have our jar file ready, we can automate the deployments with Ant Tasks by using the res-deploy command.
- You will need to add a new target to your build ant file or create a new one, this command requires the login credentials, jar path and hostname.
- Please refer to the following example:
Results:
After running our deploy command we see our Ruleapp deployed in the RES:
There are many more automation and integration to be done with Ant Tasks, please let me know what you wish to see next, and as always feel free to comment or contact me with any feedback or support! Thank you!
- Published in Ant Tasks, Rule Authoring, Rule Designer, Rule Execution Server (RES)