-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DOC-2733] Additional matrix examples #1023
Conversation
Preview environment: https://hdh.pr.harness.io/pr-1023 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with suggestions
|
||
To define an axis as runtime input, mark it as `<+input>`. | ||
|
||
When you execute the pipeline, you are prompted to enter its value, which you can add as an array. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you run the pipeline, you will be prompted to provide the matrix value. You can add it as an array.
|
||
Let us look at an example. | ||
|
||
If you wish to run your test on different versions of Go, the list of different versions will be available at runtime. You can set the axis of the matrix as an input at runtime in this case as : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to run your test on different versions of Go, a list of available versions will be available at runtime. Following is an example of setting the axis of a matrix as a runtime input:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above comment has the word "available" twice in a single sentence. I will retain the initial statement since it is an example that is being explained here.
GoVersion: <+input> | ||
``` | ||
|
||
Here is the YAML of a sample pipeline where the versions of Go are defined as runtime input: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following YAML file shows a sample pipeline in which different versions of Go are defined as runtime inputs:
|
||
#### Support a few axes of matrix as runtime inputs | ||
|
||
When you have a matrix with more than one axis, you can set a few of the axes as runtime inputs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If your matrix has more than one axis, you can set some of them as runtime input.
docs/platform/8_Pipelines/w_pipeline-steps-reference/additional-matrix-examples.md
Outdated
Show resolved
Hide resolved
docs/platform/8_Pipelines/w_pipeline-steps-reference/additional-matrix-examples.md
Outdated
Show resolved
Hide resolved
docs/platform/8_Pipelines/w_pipeline-steps-reference/additional-matrix-examples.md
Outdated
Show resolved
Hide resolved
``` | ||
## Provide the axis value of matrix from triggers | ||
|
||
To provide the axis value from a trigger, define the axis values which has a comma separated list of string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To provide the axis value from a trigger, define the axis values, which have a comma separated list of strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a single list, so this should be "has a comma-separated list of strings."
|
||
To mark the full matrix as a runtime input, mark the matrix field as `<+input>`. You can then provide the axis and its values at runtime. | ||
|
||
For example, when you need to provide the combinations during runtime, mark the matrix as `<+input>` and then during execution, provide the corresponding values. This way, the executor can provide the values as needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, if you need to input the combinations during runtime, mark the matrix as '+input>' and then provide the corresponding values during execution. The executor can then deliver the values as needed.
|
||
## Support complex JSON as an axis in matrix | ||
|
||
If you're not sure what value an object should have in a pipeline, you can store it as a JSON string instead. This way, you can use the JSON functor to get a list from the object, in case it is the output from a previous step. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are unsure about the value of an item in a pipeline, you can store it as a JSON string instead. This way, if an object is an output of the previous step, you can use the JSON functor to get a list from that object.
62ed5d1
…l-matrix-examples.md Co-authored-by: Sudheendra Katte <114551660+SudheendraKatte@users.noreply.github.com>
…l-matrix-examples.md Co-authored-by: Sudheendra Katte <114551660+SudheendraKatte@users.noreply.github.com>
…l-matrix-examples.md Co-authored-by: Sudheendra Katte <114551660+SudheendraKatte@users.noreply.github.com>
Preview environment: https://hdh.pr.harness.io/pr-1023 |
Harness Developer Pull Request
Thanks for helping us make the Developer Hub better. The PR will be looked at
by the maintainers.
What Type of PR is This?
If tied to an Issue, list the Issue(s) here:
House Keeping
Some items to keep track of. Screen shots of changes are optional but would help the maintainers review quicker.