Spinnaker Create Pipeline from Command Line: Difference between revisions
Jump to navigation
Jump to search
(7 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
=Overview= | =Overview= | ||
A pipeline, including its [[Spinnaker_Pipeline#Parameter|parameters]], can be fully declared in a JSON file and then instantiated via CLI. | A pipeline, including its [[Spinnaker_Pipeline#Parameter|parameters]], can be fully declared in a JSON file and then instantiated via CLI. | ||
The JSON representation is similar to: | |||
<syntaxhighlight lang='json'> | |||
{ | |||
"schema": "v2", | |||
"application": "aiml-automation-test", | |||
"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 Judgement", | |||
"type": "manualJudgment", | |||
"instructions": "Do you like the ${execution.trigger.parameters['color']} color?", | |||
"judgmentInputs": [ | |||
{ | |||
"value": "Yes" | |||
}, | |||
{ | |||
"value": "No" | |||
} | |||
], | |||
"failPipeline": true | |||
} | |||
] | |||
} | |||
</syntaxhighlight> | |||
Once saved in <code>some-file.json</code>, the pipeline can be created with: | |||
<syntaxhighlight lang='bash'> | |||
spin pipeline save --file ./some-file.json | |||
</syntaxhighlight> | |||
The pipeline can be executed from the UI, where the "Select Execution Parameters" window will pop up, or from the command line with a <code>--parameter-file</code> option, that will provide the value of the parameters that way. | |||
<syntaxhighlight lang='bash'> | |||
spin pipeline execute --application "<application-name>" --name "<pipeline-name>" --parameter-file "<parameter-file>" | |||
</syntaxhighlight> | |||
More details on execution are available here: {{Internal|Spinnaker Executing a Pipeline in Command Line#Overview|Executing a Pipeline in Command Line}} |
Latest revision as of 03:54, 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": "aiml-automation-test",
"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 Judgement",
"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
The pipeline can be executed from the UI, where the "Select Execution Parameters" window will pop up, or from the command line with a --parameter-file
option, that will provide the value of the parameters that way.
spin pipeline execute --application "<application-name>" --name "<pipeline-name>" --parameter-file "<parameter-file>"
More details on execution are available here: