Launching a Sandbox from Spinnaker

  • 12 April 2022
  • 0 replies
  • 14 views

After installation you will have two stages added to your Spinnaker stages list:

list

Start Sandbox Stage

start

  • Blueprint Name - Provide the name of the blueprint to be used as a source for the sandbox.
  • Sandbox Name - Provide a name for the sandbox.
  • Space Name - The name of the Torque Space your repository is connected to.
  • Artifacts - [Optional] A comma-separated list of artifacts per application. These are relative to the artifact repository's root defined in Torque. Example: appName1=path1, appName2=path2.
  • Inputs - [Optional] You can provide the blueprint's inputs as a comma-separated list of key=value. For example: key1=value1, key2=value2.
  • Timeout - Set the timeout to wait (in minutes) for the sandbox to become active. If not set, an action just starts a sandbox and returns its ID without waiting for 'Active' status.
  • Duration - Set the sandbox duration in minutes. The sandbox will automatically de-provision at the end of the provided duration.
  • Token - [Optional] Provide the long term Torque token, if you want to override the default one which is set in the global configuration. You can generate it in Torque > Settings > Integrations or via the REST API.

Stage outputs

In your later stages you can use the following data generated by "Torque Start Sandbox" stage:

  • sandboxId - an ID of started Torque sandbox. Could be referenced by:

    ${ #stage("Torque Start Sandbox")["outputs"]["sandboxId"]}

  • sandboxUrl - a Sandbox permalink. Available if Torque account is set in global configuration. Could be referenced by::

    ${ #stage("Torque Start Sandbox")["outputs"]["sandboxUrl"]}

  • SandboxDetails - Json object which contains full details of launched sandbox. Could be referenced by:

    ${ #stage("Torque Start Sandbox")["outputs"]["SandboxDetails"]}.

    Example json:

    {
    "id":"8nxzgyg26203c1",
    "name":"demoSb",
    "blueprint_name":"Jenkins",
    "applications":
    [
    {
    "name":"jenkins",
    "shortcuts":
    [
    "http://sandb-MainA-51RZLQWVANAI-1610354864.us-west-1.elb.amazonaws.com:8080"
    ],
    "status":"Done"
    }
    ],
    "sandboxStatus":"Active",
    "sandboxErrors":[]
    }
  • QuickLinks - Json object with a list of quick links per each application. Could be referenced by:

    ${ #stage("Torque Start Sandbox")["outputs"]["QuickLinks"]}.

    Example json:

    [
    {
    "name":"app1",
    "shortcuts":
    [
    "http://sandb-MainA-51RZLQWVANAI-1610354864.us-west-1.elb.amazonaws.com:8080"
    ],
    "status":"Done"
    },
    {
    "name":"app2",
    "shortcuts":
    [
    "http://sandb-MainA-51RZL1DVANAI-1243454864.us-west-1.elb.amazonaws.com:5050"
    ],
    "status":"Done"
    }
    ]

End Sandbox Stage

end

  • Space Name - The name of the Torque Space your repository is connected to. You can use the following expression in order to take the space value from "Start Sandbox" stage: 
    ${ #stage("Torque Start Sandbox")["context"]["space"]}
  • Sandbox ID - Provide the ID of the sandbox you want to end. In most cases you will take it from Start Sandbox Stage context: 
    ${ #stage("Torque Start Sandbox")["outputs"]["sandboxId"]}
  • Token - [Optional] Provide the long term Torque token, if you want to override the default one which is set in the global configuration. You can generate it in Torque > Settings > Integrations or via the REST API.

0 replies

Be the first to reply!

Reply