Manage Pipelines

Use spin to manage your Spinnaker pipelines.

Overview

spin can manage the whole lifecycle of your pipeline:

  1. $ spin pipeline
  2. Usage:
  3. pipeline [command]
  4. Aliases:
  5. pipeline, pipelines, pi
  6. Available Commands:
  7. delete Delete the provided pipeline
  8. execute Execute the provided pipeline
  9. get Get the pipeline with the provided name from the provided application
  10. list List the pipelines for the provided application
  11. save Save the provided pipeline
  12. Flags:
  13. -h, --help help for pipeline
  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 [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’s Lifecycle

Create and update pipelines with save

  1. $ spin pipeline save --file <path to pipeline json>
  2. Parsed submitted pipeline: <...>
  3. Pipeline save succeeded

Note that save accepts pipeline in JSON format. You can quickly export an existing pipeline into a valid argument to the --file flag by using the get command. You can also export pipeline JSON from the pipeline UI in Deck by clicking Pipeline Actions > Edit as JSON and copying the JSON contents, e.g.

Manage Pipelines - 图1

You can also template the pipeline JSON using your favorite templating engine.

List pipelines in an application with list

  1. spin pipeline list --application my-app
  2. [
  3. ...
  4. {
  5. "application": "my-app"
  6. ...
  7. }
  8. ...
  9. ]

Retrieve a single pipeline with get

Get a single pipeline with get:

  1. spin pipeline get --name my-pipeline --application my-app
  2. {
  3. "application": "my-app"
  4. "stages": [...]
  5. }

Start a pipeline execution with execute

Start a pipeline execution with execute:

  1. spin pipeline execute --name my-pipeline --application my-app
  2. Pipeline execution started

If your pipeline is parameterized, you can submit a JSON-formatted map of the parameters and their values via the --parameter-file flag

  1. {
  2. "parameter1": "value1",
  3. "parameter2": "value2",
  4. ...
  5. }

Delete a pipeline with delete

  1. spin pipeline delete --name my-pipeline --application my-app
  2. Pipeline deleted

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