Hedgehog Documentation

The Pipeline JSON Model

  • Last Modified: 2019-07-17

Pipelines are stored as JSON-formatted files in rafts. You can edit pipelines in the web interface using the visual or text mode, or may be edited externally if a raft supports it (i.e. on disk, on GitHub, etc.)

Pipeline

A pipeline consists of a sequence of stages, variables, and several other properties and options. The following are the contents of a pipeline's JSON file.

Color a string in the format #RRGGBB used to represent the color used in the UI
Description a string to document the pipelines intended usage
EnforceStageSequence a boolean to indicate whether the stage sequence should be enforced (requiring a Force to override), or if any stage can be deployed to at any time
PostDeploymentOptions an object with the following property/value pairs. Each value is a boolean.
  • CancelReleases: cancel earlier (lower-sequenced) releases that are still active and have not yet been deployed.
  • CreateRelease: creates a new release by incrementing the final part after a release has been deployed.
  • DeployRelease: mark the release and package as deployed once it reaches the final stage.
Variables an object with property/values representing variable names and values
  • a variable name is a string of no more than fifty characters: numbers (0-9), upper- and lower-case letters (a-Z), dashes (-), spaces ( ), and underscores (_) and must start with a letter, and may not start or end with a dash, underscore, or space; a variable
  • a variable value is a string of any number of characters
Stages an array of Stage objects

Stage

A stage consists of a gate, variables, pre-deployment steps, targets, post-deployment steps, and several properties and options.

This object is used to describe the Stage property of a Pipeline object.

Name a string representing the name of the stage
Description a string to document the stage's intended usage
AutoPromote a boolean indicating whether a deployment to the next stage will automatically occur if the target is next stage's gate is met
TargetExecutionMode a string with either Parallel or Sequential
Gate a Gate object
Variables an object with property/values representing variable names and values
  • a variable name is a string of no more than fifty characters: numbers (0-9), upper- and lower-case letters (a-Z), dashes (-), spaces ( ), and underscores (_) and must start with a letter, and may not start or end with a dash, underscore, or space; a variable
  • a variable value is a string of any number of characters
PreDeploymentSteps an array of strings containing OtterScript strings that are run prior to target evaluation
Targets an array of Target objects
PostDeploymentSteps an array of objects or strings, representing steps that are run after target execution

Each object has two properties:
  • Script: a string containing an OtterScript string
  • RunOnFail: a boolean indicating if the step should run even if one of the targets failed
a string in this array is an OtterScript that is run only when all targets succeeded

Gate

A gate is a mix of manual and automated approval requirements that a deployment set must have before being deployed to a stage, and are used to ensure the quality and acceptability of a deployment set as it passes through the pipeline.

This object is used to describe the Gate property of a Stage object.

UserApprovals an array of objects representing people that must approve deployment into the stage; each object has two properties:
  • Name: a string of the username of the approver
  • Description: a string of what will be displayed on the approvals required and received
GroupApprovals an array of objects representing people in groups that must approve deployment into the stage; each object has two properties:
  • Name: a string of the group name that an approver belongs to
  • Description: a string of what will be displayed on the approvals required and received
  • Count: an integer of how many approvers in that group must approve the deployment set before it's met

Target

A target is comprised of a deployment plan, an environment name, a list of servers or roles, and a list of packages to be deployed. All these fields support variable expressions, which you can even set in the pre-deployment steps.

This object is expected in the Targets array property on the Stage object.

UserApprovals a string of the plan name that will be executed at the target, or null to use the plan embedded in the packages
EnvironmentName a string of the name of the environment that is targeted
RoleNames an array of strings representing the roles that are targeted
ServerNames an array of strings representing the names of the servers targeted
PackageNames an array of strings representing the names of packages to iterate over

null indicates all packages

an empty array indicates no packages

OtterScript String

OtterScript strings are JSON-encoded strings with optional additional header directives that are used by the UI to determine which pre- or post-deployment step types are displayed.

Here are some examples of valid OtterScript strings in JSON:

"##AH:PowerShell\r\n\r\nPsExec\r\n(\r\n    Text: write-host \"Hello from PowerShell\";\r\n);\r\n",
"##AH:Email\r\n\r\nSend-Email\r\n(\r\n    To: user@example.com,\r\n    Subject: Hello,\r\n    Body: Body text\r\n);\r\n",
"##AH:SetVariable\r\n\r\nset $TestVariable = TestValue;\r\n",
"Exec D:\\Tools\\tool.exe;"

Is this documentation incorrect or incomplete? Help us by contributing!

This documentation is licensed under CC-BY-SA-4.0 and stored in GitHub.

Generated from commit ce197caa on master