Pipeline Templates

Pipeline template JSON

A pipeline template uses the following config JSON:

  1. {
  2. "schema": "v2",
  3. "variables": [
  4. {
  5. "type": "<type>",
  6. "defaultValue": <value>,
  7. "description": "<description>",
  8. "name": "<varName>"
  9. }
  10. ],
  11. "id": "<templateName>", # The pipeline instance references the template using this
  12. "protect": <true | false>,
  13. "metadata": {
  14. "name": "displayName", # The display name shown in Deck
  15. "description": "<description>",
  16. "owner": "example@example.com",
  17. "scopes": ["global"] # Not used
  18. },
  19. "pipeline": { # Contains the templatized pipeline itself
  20. "lastModifiedBy": "anonymous", # Not used
  21. "updateTs": "0", # Not used
  22. "parameterConfig": [], # Same as in a regular pipeline
  23. "limitConcurrent": true, # Same as in a regular pipeline
  24. "keepWaitingPipelines": false, # Same as in a regular pipeline
  25. "description": "", # Same as in a regular pipeline
  26. "triggers": [], # Same as in a regular pipeline
  27. "notifications": [], # Same as in a regular pipeline
  28. "stages": [ # Contains the templated stages
  29. {
  30. # This one is an example stage:
  31. "waitTime": "${ templateVariables.waitTime }", # Templated field.
  32. "name": "My Wait Stage",
  33. "type": "wait",
  34. "refId": "wait1",
  35. "requisiteStageRefIds": []
  36. }
  37. ]
  38. }
  39. }

Pipeline JSON

A pipeline instance that implements a pipeline template uses the following config:

  1. {
  2. "schema": "v2",
  3. "application": "<appName>", # Set this to the app you want to create the pipeline in.
  4. "name": "New Pipeline Name", # The name of your pipeline.
  5. "template": {
  6. "type": "front50/pipelineTemplate",
  7. "artifactAccount": "front50ArtifactCredentials",
  8. "reference": "spinnaker://<templateName>"
  9. },
  10. "variables": {
  11. "<varName>": <value>, # Value for the template variable.
  12. "someOtherVar": <value>
  13. },
  14. "inherit": [],
  15. "triggers": [],
  16. "parameters": [],
  17. "notifications": [],
  18. "description": "",
  19. "stages": []
  20. }

A more thorough explanation of some fields such as protect can be found in the v1 schema here .


Last modified September 28, 2020: rest of reference cleanup work (a023331)