Pre - and Post - Push Script Usage Steps

Prerequisites

  • If the scripts are written using Python:
    • Scripts for the on-prem deployment should start with
      #!/appviewx/dependencies/appviewx_addons/Python/bin/python
    • Scripts for the SaaS deployment should start with
      #!/usr/bin/python
  • The script input can be consumed using the command line argument sys.argv[1]
  • The script output should be in the JSON format, generated only using the print statement.
  • Script Output Script Execution Status
    AppResponseCode:0 Success
    AppResponseCode:-1 or any other script errors Failure
  • The script should be code-signed. Please contact AppViewX Support ([email protected]) to get the script code signed.

Using Scripted Integrations for On-prem

  1. Get the code-signed script from the AppViewX support team ([email protected]). This will be a .zip file that includes the script and the signature.
  2. Save the code-signed .zip file in all the AppViewX vendors pods running node file system.

    Default path: <home>/appviewx/appviewx_dependencies/aps/

  3. Mention in the .zip filename in all the relevant fields in the CERT+ user interface.
    Note: The folder path for the file is not required. Custom folder paths are restricted.
Sample success script for the on-prem deployment:
#!/appviewx/dependencies/appviewx_addons/Python/bin/python
print({"status":"AppResponseCode:0"})

Using Scripted Integrations for SaaS

  1. Get the code-signed script from the AppViewX support team ([email protected]). This will be a .zip file that includes the script and the signature.
  2. Save the .zip file in all machines with the AppViewX Cloud Connector at the following location: <CC_INSTALLATION_PATH>/deps/aps/.
  3. Mention in the .zip filename in all the relevant fields in the CERT+ user interface.
    Note: The folder path for the file is not required. Custom folder paths are restricted.
Sample success script for the SaaS deployment:
#!/usr/bin/python
print({"status":"AppResponseCode:0"})

Troubleshooting Script Usage Issues

Table 1.
Error Cause Resolution
File not found The python path mentioned in the script file is not correct. Check the path in the vendors pod or the mid-server-platform pod.
For Python scripts:
  • Scripts for the on-prem deployment should start with
    #!/appviewx/dependencies/appviewx_addons/Python/bin/python
  • Scripts for the SaaS deployment should start with
    #!/usr/bin/python
…bin/python^M: bad interpreter The ^M is a carriage return character. Linux uses the line feed character to mark the end of a line, whereas Windows uses the two-character sequence CR LF. Your file has Windows line endings, which is confusing Linux Remove the spurious CR characters and then code sign the script.
You can remove these characters using the command:
sed -i -e 's/\r$//' scriptname.py