Running custom scripts before and after synchronization

You can create custom scripts that run before and after synchronization. For example, a common pre-synchronization scenario might be to merge a parent stream into the synchronization stream, while a common post-synchronization scenario might be to create a Rational® ClearCase® baseline or start a Jazz™ Team Server build.

About this task

To create custom scripts:


  1. From the ClearCase-Synchronized Streams view, right-click the synchronized stream, and select Properties.
  2. In the left navigation, click Jazz Provider Properties.
  3. In the Argument Name column, locate PRE_SYNC_OPERATION_PATH (to run a script before synchronization) or POST_SYNC_OPERATION_PATH (to run a script after synchronization).
  4. In the corresponding Argument Value field, type an absolute or relative path to a command.

    In the following example, argument values are supplied in both of the fields:

    Jazz Provider Properties

  5. After you set the values, click OK. The scripts run during the next synchronization.
    Scripts are invoked with the environment variables. You can retrieve these values in a script:
    Table 1.
    Variable Description
    CTPROVIDER_* All Rational ClearCase provider property values are available with the prefix CTPROVIDER_. To see the values, right-click the synchronization stream, and then click Properties. From the left navigation, click ClearCase Provider Properties.
    JZPROVIDER_* All Jazz Team Server provider property values are available with the prefix JZPROVIDER_. To see the values, right-click the synchronization stream, and then click Properties. From the left navigation, click Jazz Provider Properties.
    Synchronization Build Properties User-defined and built-in build engine properties. For more information, see Build properties.
    SYNC_OPERATION_STATUS Returns the synchronization result status. When the synchronization is successful, the status returned is OK. When the synchronizer detects a change conflict and requires a manual merge, the status returned is MERGE_NEEDED. For more information, see Resolving conflicts during synchronization.
    SYNC_OPERATION_ERROR_MESSAGE Returns the synchronization result error message.
    SYNC_OPERATION_ACTIVITY_ID Returns the current synchronization build result's activity. The action command can contribute sub-activities under the main activity.
    Note: When the pre-synchronization script fails (for example, the synchronization exits with a non-zero value), the subsequent synchronization is not run. In this scenario, you can run verification scripts prior to running the synchronization to check for this type of condition.

    The post-synchronization script runs regardless of the synchronization results. The synchronizer sets the SYNC_OPERATION_STATUS variable for the post-synchronization script. With this information, you can automate decision-making by setting conditions based on the status of this variable.

    Note: When you specify a custom script in a Rational ClearCase VOB, it is required that you set the execute permission of the script file. You can set the permission by cleartool protect command.

video icon Video channel
Software Education channel

learn icon Courses

IoT Academy
Skills Gateway

ask icon Community forums library

support icon Support

IBM Support Community
Deployment wiki