Spinnaker Create Pipeline from Command Line: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 10: Line 10:
   "schema": "v2",
   "schema": "v2",
   "application": "my-application",
   "application": "my-application",
   "name": "my-pipeline",
   "name": "color-pipeline",
   "keepWaitingPipelines": false,
   "keepWaitingPipelines": false,
   "limitConcurrent": true,
   "limitConcurrent": true,
   "parameterConfig": [
   "parameterConfig": [
     {
     {
       "name": "param_1",
       "name": "color",
       "default": "value 1",
       "default": "blue",
       "label": "The first parameter",
       "label": "The Color",
       "description": "This is the description of param_1",
       "description": "The color to be presented to the user",
       "pinned": true,
       "pinned": true,
       "required": true
       "required": true
Line 28: Line 28:
       "name": "Manual Judgment",
       "name": "Manual Judgment",
       "type": "manualJudgment",
       "type": "manualJudgment",
       "instructions": "the value of param_1: ${execution.trigger.parameters['param_1']}",
       "instructions": "Do you like the ${execution.trigger.parameters['color']} color?",
       "judgmentInputs": [
       "judgmentInputs": [
         {
         {
           "value": "Option 1"
           "value": "Yes"
         },
         },
         {
         {
           "value": "Option 2"
           "value": "No"
         }
         }
       ],
       ],

Revision as of 03:44, 31 May 2023

Internal

Overview

A pipeline, including its parameters, can be fully declared in a JSON file and then instantiated via CLI.

The JSON representation is similar to:

{
  "schema": "v2",
  "application": "my-application",
  "name": "color-pipeline",
  "keepWaitingPipelines": false,
  "limitConcurrent": true,
  "parameterConfig": [
    {
      "name": "color",
      "default": "blue",
      "label": "The Color",
      "description": "The color to be presented to the user",
      "pinned": true,
      "required": true
    }
  ],
  "stages": [
    {
      "refId": "1",
      "name": "Manual Judgment",
      "type": "manualJudgment",
      "instructions": "Do you like the ${execution.trigger.parameters['color']} color?",
      "judgmentInputs": [
        {
          "value": "Yes"
        },
        {
          "value": "No"
        }
      ],
      "failPipeline": true
    }
  ]
}

Once saved in some-file.json, the pipeline can be created with:

spin pipeline save --file  ./some-file.json