It's all about the answers!

Ask a question

How to use zospackage.xml to automate the RTC Enterprise package after zOS dependency build is completed?


Dhinesh Palanisamy (152) | asked Jun 21 '18, 5:30 a.m.

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


permanent link
Louis Lock (302) | answered Jun 21 '18, 9:53 a.m.

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.

Dhinesh Palanisamy selected this answer as the correct answer

Comments
Dhinesh Palanisamy commented Jun 22 '18, 4:59 a.m.

  Hi Louis,


                  Thanks for making me understand "How the zospackage.xml is used". Initially I presumed that customizing zospackage.xml the Enterprise package can be triggered. Trust from your side is always helpful, I like to list down my queries if possible please recitify me.
 1.As you mentioned about triggering a UCD process - what and where I need to customize the zospackage.xml  script file? if it possible then UCD process will be started without manual  interpretation 

2.Do you have any idea about post-build script in build- definition and how to write script to invoke other process - like Ant script ?





Louis Lock commented Jun 26 '18, 7:00 p.m.

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.


Dhinesh Palanisamy commented Jul 04 '18, 5:48 a.m.

 Hi Louis,


I assume that the ant script for executing requestApplicationProcess method should be under the target that is newly added.
I am not sure how to refer ucdclient.jar from that script and invoke the method. Could you please help me out with a sample snippet?


1
Louis Lock commented Jul 05 '18, 7:31 p.m.

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...

 


Louis Lock commented Jul 05 '18, 7:34 p.m.

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!


Dhinesh Palanisamy commented Jul 09 '18, 11:34 p.m.

Thanks Louis, it got worked.

showing 5 of 6 show 1 more comments

Your answer


Register or to post your answer.