Using Scripts
In the Console mode and the GUI mode, the actions are recorded in the form of a script (targets_config.bat or targets_config.sh). This script can be modified and re-used later.
The last screen during upgrade or downgrade, that is, the Summary screen shows the location where the scripts are saved (Session Scripts and Log Folder). This folder contains a "Batch" script or a "Shell" script ( depending on the operating system) in the scripts folder.
You can double-click the batch file to run it. It starts executing whatever was selected during TCT screens.
In the Summary screen (GUI mode only), if you choose to skip any of the four actions ("Stop", "Upgrade", "Perform post-upgrade task" and "Start" Host) and save it, the build.properties file is updated to reflect this.
For example, if you choose to skip "Stop All Host" and skip "Start All Hosts", you will see two new properties added to the build.properties file.
skip.host.stop=true skip.host.start=true
ANT scripts
TCT at the end of the wizard creates a build.xml file that is the main ANT build file. Using this ANT file, TCT performs upgrade or downgrade. You can run this build.xml file manually as well.
The build.xml file takes its input from the build.properties file. Any upgrade or downgrade instructions or settings must be added to this file.
File | Description |
---|---|
tct-tools.xml | This is standard tct build file - have "-init" target in it. |
patchmgr-task-3.4.0.xml | This is an XML file that sets a CLASSPATH for running the Host Manager commands. Most of the upgrade and downgrade is performed by the Host manager located in TIBCO_HOME\amx\3.4\bin. ANT calls the Host manager using an ANT task. This file defines the ANT tasks and sets a CLASSPATH for them. |
tct-helper.xml | This build file defines a code for many of the targets that are exposed in the top level build.xml. It defines "do.run.upgrade.downgrade, do.stop, do.upgrade_downgrade and do.post_upgrade targets. |
process_form_apps.xml | This build file is actually not used by the top-level build.xml file but rather used by tct-helper.xml. this build file defines targets that are needed for platform app upgrade or downgrade. |
Is "ant -f build.xml stopupgrade_downgrade post.upgrade start" the same as "ant -f build.xml run.upgrade.downgrade" ?
No. If you call targets "stop upgrade_downgrade post.upgrade start", ANT calls each target one after the other. For example, consider 3 hosts in a CONFIG_HOME. If you call targets described as before, ANT calls the stop target first and it stops all 3 hosts. Then, it calls the upgrade_downgrade target and performs either upgrade or downgrade depending on the input selected in the build.properties file for all 3 hosts. Then, it performs the post.upgrade followed by calling the start target.
Sample Output - Success
[11 Jun 2018 18:02:31,420] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #Ant properties #Sun Jun 11 18:02:31 PDT 2018 tibco.host.Admin-dev-enterprise-instanceOne.Downgrade.status=SUCCESS tibco.host.RunTimeHost.Downgrade.status=SUCCESS tibco.host.RunTimeHost11.Downgrade.status=SUCCESS tibco.host.RunTimeHost2.Downgrade.status=SUCCESS tibco.host.RunTimeHost3.Downgrade.status=SUCCESS tibco.host.RunTimeHost4.Downgrade.status=SUCCESS tibco.host.RunTimeHost5.Downgrade.status=SUCCESS tibco.host.RunTimeHost6.Downgrade.status=SUCCESS tibco.host.RunTimeHost7.Downgrade.status=SUCCESS tibco.host.RunTimeHost8.Downgrade.status=SUCCESS tibco.host.RunTimeHost9.Downgrade.status=SUCCESS [11 Jun 2018 18:02:31,422] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sample Output - Failure
[12 Jun 2018 13:44:29,636] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #Ant properties #Mon Jun 12 13:44:29 PDT 2018 tibco.host.RuntimeHost3.Upgrade.status=FAILURE tibco.host.RuntimeHost3.Upgrade.status.error=The following error occurred while executing this line\:\r\nC\:\\tibco_amx331_for_340\\amx\\3.4\\scripts\\upgrade\\upgrade-to-3.4.0\\platformApp\\tct-helper.xml\:316\: The following error occurred while executing this line\:\r\nC\:\\tibco_amx331_for_340\\amx\\3.4\\scripts\\upgrade\\upgrade-to-3.4.0\\platformApp\\tct-helper.xml\:328\: The following error occurred while executing this line\:\r\nC\:\\tibco_amx331_for_340\\amx\\3.4\\scripts\\upgrade\\upgrade-to-3.4.0\\platformApp\\process_platform_apps.xml\:237\: The following error occurred while executing this line\:\r\nC\:\\tibco_amx331_for_340\\amx\\3.4\\scripts\\upgrade\\upgrade-to-3.4.0\\platformApp\\process_platform_apps.xml\:275\: One of the nodes failed to perform upgrade of platform App - please check logs at \: E\:\\amxconfig\\config_331_RuntimeHost2\\tct\\tct.upgrade.downgrade\\2018-06-12-13-20-10\\logs\\platformApp.logs\\12-Jun-2018-13_43_40.updatePlatformApp.admin.cmdline.log for more information tibco.host.RuntimeHost4.Upgrade.status=FAILURE tibco.host.RuntimeHost4.Upgrade.status.error=The following error occurred while executing this line\:\r\nC\:\\tibco_amx331_for_340\\amx\\3.4\\scripts\\upgrade\\upgrade-to-3.4.0\\platformApp\\tct-helper.xml\:242\: TIBCO-AMX-TOOLS-PATCHMGR-000601\: One or more Host instances have not started or they are still starting. Make sure all Host instances have started. Start a Host instance manually if it has not started. [12 Jun 2018 13:44:29,652] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~