Scripts Library Help Documentation

Scripts are utilized when the user has a large piece of code. The Opsera Scripts Library enables the user to register a new script, give it a name and apply RBAC (to define who sees it). Instead of adding the code into the pipeline steps, it is added into the Script Library and then referenced in the pipeline step. Use this document as a guide to add new scripts into the Scripts library and then accurately reference them in the pipeline step.

Add a new script to the Scripts Library

  1. Navigate to Tool Registry → Scripts

2. Select + New Script button.

  • Name - Choose a unique name for your script

  • Language - Choose a language for the script.

  • Script - Use this space to input the code you will reference in your pipeline step.

  • Roles - Add user role and select Add Role.

3. Select Create.

Follow the next steps to configure scripts into an Octopus Deploy step.

Configure Scripts into Pipeline Step

  1. Navigate to your pipeline.

  2. Locate the Octopus Deploy step and click on the gear icon (⚙️) to open up the step configurations.

     

  3. In Step Configurations, choose the selections from the drop downs to reference your Script from the Script Library:

  • Octopus Platform Type - Script or Kubernetes

  • Octopus Deployment Type - Run a Script

  • Script Type:

    • Inline:

      • Opsera Script Library - From the drop down, select the script that was previously added to the Opsera Script Library. To verify that you are selecting the correct script, click View this Script to load a full panel read-only screen of the script.

    • Package:

      • Script File Name -

      • Script Parameters -

      • Octopus Feed -

      • Rollback to Previous Version -

        • Version -

      • Specify Deployment Variables -

    • Specify Deployment Variables - Toggle on to enter deployment variables as a list of JSON Objects.

      • Structured Configuration Variables Path -

      • XML Configuration Transformed Variable Value -

4. Select Save button to save the pipeline step. During the pipeline run, when this step is reached, the parameter will be referenced.