In this section: |
This section describes the different ways of using Ant scripts.
How to: |
You can build and publish an application using the Ant Script.
To publish iIA from iIT using the Ant script:
If you are familiar with Apache Ant, then you should be able to recognize iWay Ant Tasks, Ant Properties, and eventually find it easier to create your own deployment scripts.
The dialog lists multiple deployment options available for you. You can select one option or a number of options in sequence.
A confirmation dialog appears.
A success message of the build and upload operation appears in the console view.
How to: |
This section develops Ant scripts that create a backup directory under the iWay Home directory. The script is added to an application as a file resource and then invokes the remote Ant script using the iwscript iWay Ant task.
To invoke a remote Ant script, you must first create an Ant script by creating a new integration project and opening the XML editor.
The New XML file wizard is located under the XML section.
After opening the XML file and writing the project XML tag, the XML editor is replaced with the Ant editor. The following image shows a sample remote Ant file.
The target, “mkdir”, uses the environment variable on the remote machine to find the iWay home directory and creates a backup directory there.
The execution log appears, as shown in the following image.
The new backup directory is successfully created on the remote machine. This is a permanent change to the iWay Installation, and will stay even if the Ant application is deleted.
Note: You must be careful with remote Ant script invocations since it is a strong feature which may produce irreversible results.
How to: |
You can publish templates to the same local server, using a different template name.
To publish templates from Ant:
The new template with_logging appears on the iSM console.
When an application is uploaded to iSM, the application receives a version and cannot be deleted except from the iSM console. However, deployments and templates are not versioned, and can be deleted from Ant using the "iwdelete" iWay Ant task.
The following example shows an Ant target that removes a deployment or a template named “fred”.
You can add new targets to an Ant script that performs the following in order:
The following example shows how the additional targets appear.
<target name="do_all" depends="undeploy, build, upload, deploy , script"/> <!-- - - - - - - - - - - - - - - - - - target: push_everywhere , calls 'push' for a list of servers - - - - - - - - - - - - - - - - - --> <target name="push_everywhere" depends="build"> <antcall target="push"> <param name="server" value="portnoy7"/> </antcall> <antcall target="push"> <param name="server" value="gitlin-xp"/> </antcall> </target> <!-- - - - - - - - - - - - - - - - - - target: push , combines a sequence of iway ant tasks - - - - - - - - - - - - - - - - - --> <target name="push" description="upload application and template, and deploy them"> <iwupload serverURL="http://${server}:9000" userName="${server.user}" password="${server.password}" /> <iwaddtemplate templateName="${new.template.name}" fileName="${template.file.name}" serverURL="http://${server}:9000" userName="${server.user}" password="${server.password}" /> <iwdeploy templateName="${new.template.name}" deploymentName="${deployment.name}" serverURL="http://${server}:9000" userName="${server.user}" password="${server.password}" /> </target>
Note: The user name and password are the same across the enterprise installations of iWay. If they were not the same, the script would be more involved.
The following image shows the trace for running the script, where both application and template were uploaded and deployed together on both servers.
|
iWay Software |