How to use zospackage.xml to automate the RTC Enterprise package after zOS dependency build is completed?
I'm using Enterprise packaging to move the RTC component to UCD, I'm in the amid of automating the package after zOS dependency build is completed, while searching for the automation script have had come across zospackage.xml . Here my doubt is how and where to use the zospackage.xml to automate the package? is there any document available to explore the zospackage.xml
Accepted answer
Hi Dhinesh, I'm using RTC version 6 and not sure yours. A package definition needs to be defined. In the z/OS Packaging tab of the package definition, you can define the UrbanCode Deploy packaging options as well as specifying the UCD component name. The zospackage.xml script is part of the RTC Build Toolkit and it is called by another script "package.xml" which is defaulted as the build file. You can confirm that in the Ant tab of the package definition. If you only want to move the RTC components to UCD as a component verison, you don't need to change any script files provided as part of the toolkit. However, if you need to trigger a UCD process in addition, then you might need to customize the zospackage.xml script file.
Comments
Hi Louis,
Hi Dhinesh, here is my response to your questions....
1) To automatically trigger a UCD process, you can add a new target e.g. "launchUcdProcess" as a dependent of "postPackage" in zospackage.xml (be reminded to backup the original xml before change in case you need to revert back). In "launchUcdProcess", execute the "requestApplicationProcess" method from the ucd client package "udclient.jar" with parameters like UCD application name, UCD application process, environment etc. defined in a json file. If you don't want to hard code the json file, you can define the parameters as properties in the RTC package definition. Set up a json template and use ant copy to pass the RTC properties to the json file.
2) Not sure...have not tried post-build script option in build definition.
Hope it helps.
Hi Louis,
Hi Dhinesh, yes the requestApplicationProcess method is under the target that is newly added. Here is a sample of the script:
<exec failonerror="true" executable="${env.JAVA_HOME}/bin/java">
<arg value="-jar"/>
<arg value="${ucd.agent.directory}/opt/udclient/udclient.jar"/>
<arg value="-weburl"/>
<arg value="${ucd.server.weburl}"/>
<arg value="-authtoken"/>
<arg value="${ucd.token}"/>
<arg value="requestApplicationProcess"/>
<arg value="${team.package.dir}/requestApplicationProcess.json"/>
</exec>
where ${ } variables are properties from RTC.
The json file can be created in a previous step from a json template like that...
1 vote
Json file template:
{
"application": "@APPNAME@",
"description": "Requesting application process",
"applicationProcess": "@APPPROCESS@",
"environment": "@APPENV@",
"onlyChanged": "false",
"versions": [
{
"version": "@VERSION@",
"component": "@COMPONENT@"
}
]
}
You can use ant copy to replace the tokens from your RTC properties in your package definition.
Hope it helps. Good luck!
Thanks Louis, it got worked.