Manage Pipeline Templates

Use spin to manage your managed pipeline templates (MPT).

Overview

Note: spin only supports pipeline templates v2.

spin can manage the whole lifecycle of your v2 pipeline templates:

  1. $ spin pipeline-templates
  2. Usage:
  3. pipeline-template [command]
  4. Aliases:
  5. pipeline-template, pipeline-templates, pt
  6. Available Commands:
  7. delete Delete the provided pipeline template
  8. get Get the pipeline template with the provided ID
  9. list List the pipeline templates for the provided scopes
  10. plan Plan the provided pipeline template config
  11. save Save the provided pipeline
  12. Flags:
  13. -h, --help help for pipeline-template
  14. Global Flags:
  15. --config string path to config file (default $HOME/.spin/config)
  16. --gate-endpoint string Gate (API server) endpoint (default http://localhost:8084)
  17. -k, --insecure ignore certificate errors
  18. --no-color disable color (default true)
  19. --output string configure output formatting
  20. -q, --quiet squelch non-essential output
  21. Use " pipeline-template [command] --help" for more information about a command.

The following assumes Spinnaker is running and Gate is listening on http://localhost:8084. If gate is running elsewhere, you can set the Gate endpoint with the global --gate-endpoint flag.

Managing Your Pipeline Template’s Lifecycle

Create and update pipeline templates with save

  1. $ spin pipeline-templates save --file <path to pipeline json>
  2. Pipeline template save succeeded

Note that save accepts the pipeline template in JSON format. You can quickly export an existing pipeline template into a valid argument to the --file flag by using the get command.

List pipeline templates for a set of scopes with list

  1. spin pipeline-templates list --scopes app1,app2
  2. # Note: --scopes is optional, by default all pipeline templates are global.
  3. [
  4. ...
  5. {
  6. "id": "myPipelineTemplate"
  7. "pipeline": {...}
  8. ...
  9. }
  10. ...
  11. ]

Retrieve a single pipeline template with get

  1. spin pipeline-templates get --id myPipelineTemplate
  2. {
  3. "id": "myPipelineTemplate"
  4. "pipeline": {...}
  5. }

Visualize a hydrated pipeline with plan

  1. spin pipeline-templates plan --file <path to pipeline config>
  2. {
  3. "application": "my-spinnaker-app"
  4. "stages": [...] # Evaluated pipeline config based on template config values.
  5. }

Delete a pipeline template with delete

  1. spin pipeline-template delete myPipelineTemplate
  2. Pipeline template deleted

Last modified May 4, 2021: more cleanup (0281411)