Introduction
This Git versioning script is built to automate the updating of transaction scripts within Catchpoint. Once the latest version of a transaction script is updated in Git, we can execute the attached Python script. This will get the latest version of the transaction script from Git and update the corresponding transaction test in the Catchpoint portal.
Note: Script requires one-time configurations as described below.
Prerequisites
- Python 3 needs to be installed.
- Catchpoint API credentials and script details to be added in the script.
Configuration
Configuring the script
-
Open the attached Python script in your preferred text editor.
-
Configure Git repository details.

-
Edit
creds_basic_CPdictionary as per your account details in Git.domainis configured to fetch raw data from Git.pathshould be modified with respectiveuser,repo name, andbranch name/master. This path should point at the file to be fetched from Git repo.
-
-
Link Catchpoint and Git scripts.

Editscript_linksdictionary to link the scripts from Catchpoint and Git. The Python script will depend on this to update all the scripts. We need to provide thescript idfrom Catchpoint withscript namefrom Git. In the screenshot above, id182823from Catchpoint references toscript1in Git. Here we are working with two scripts; we can add any number of script references as per the requirements. -
Set up Catchpoint API credentials as environment variables.

Catchpoint API key and secret should be set with environments names as shown in the screenshot above
Note: The attached script and the above configurations are tested with public Git repos. For private repose will need to add the Authentication header with Git API token.
Implementation
Run Python script
Once all the above configurations are complete, the Python script can be executed. During script execution, you will see the following prompts:
- Enter Script Name

- Confirm Script changes

- Success

How does Python script work?
- It downloads the Git script based on the configurations. During script execution, it will ask to type the script name. It will only download the specified script file.
- It generates an authentication token for communication with Catchpoint.
- It gets the current Catchpoint script details. This would include the script as well other script related information. It only modifies it to add the new scripts we got from Git.
- It sends the new script to back to Catchpoint.
Whenever you push an update to your script in Git, execute this script and provide the script name, and Catchpoint will be updated. This eliminates the need to login to the Catchpoint portal to perform the manual change.
This script four Catchpoint REST API calls to update one script.