-
Notifications
You must be signed in to change notification settings - Fork 166
RUN-643: Multiline job options beta documentation #1707
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
Open
gschueler
wants to merge
1
commit into
4.0.x
Choose a base branch
from
RUN-643
base: 4.0.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,15 +43,6 @@ level of procedure formalization. | |
value be somewhat open ended consider how you can create | ||
safeguards to control their choice. | ||
|
||
## Input Types | ||
|
||
Option Input Types define how the option is presented in the GUI, and how it is used when the Job executes. | ||
|
||
Input types: | ||
|
||
- "Plain" - a normal option which is shown in clear text | ||
- "Secure" - a secure option which is obscured at user input time, and the value of which is not stored in the database. See [secure-options](#secure-options). | ||
- "Secure Remote Authentication" - a secure option which is used only for remote authentication and is not exposed in scripts or commands. See [secure-remote-authentication-options](#secure-remote-authentication-options). | ||
|
||
## Options editor | ||
|
||
|
@@ -87,37 +78,54 @@ loaded to the Rundeck server. See [job-xml](/manual/document-format-reference/jo | |
|
||
## Defining an option | ||
|
||
**Text Options** | ||
|
||
New options can be defined by pressing the "Add an option" link while | ||
existing ones can be changed by pressing their "edit" link. | ||
|
||
### Option Types | ||
|
||
Options can be one of these types: | ||
|
||
* [Text](#text-option-type) - a single line of text, or multiple values | ||
* [File](#file-option-type) - a File upload option | ||
* [Multiline Text](#multiline-text-option-type) - multiple lines of text | ||
|
||
Depending on the Option Type selected, different configuration options are available. | ||
|
||
### Text Option Type | ||
|
||
|
||
Choose "Text" from the Option Type: | ||
|
||
 | ||
|
||
The option definition form is organized into several areas: | ||
|
||
Identification | ||
Option Name | ||
|
||
: Here you provide the option's name and description. The name | ||
becomes part of acceptable arguments to the Job while the | ||
description will be provided as help text to users running the Job. | ||
: Here you provide the option's name. This value | ||
will be used to reference the option variable within steps of the Job. | ||
|
||
The Default Value will be pre-selected in the GUI when the option is presented. | ||
Option Label | ||
|
||
: An optional display label shown in place of the Option Name when viewed in the GUI. | ||
|
||
Description | ||
|
||
: This will be provided as help text to users running the Job. | ||
|
||
Default Value | ||
|
||
: A Default Value will automatically be set for the option if it is not otherwise specified by the user, even if not specified among the arguments when executing a job via the command-line or API. Note that a blank value can be specified via the command-line or API, which will override the use of the Default Value. | ||
|
||
Input Type | ||
|
||
: Choose between "Plain", "Date", "Secure" and "Secure Remote Authentication". For input types other than "Plain", the multi-valued option will be disabled. | ||
: Choose between "Plain", "Date", "Plain Text with Password Input" and "Secure Remote Authentication". For input types other than "Plain", the multi-valued option will be disabled. | ||
|
||
Date Format | ||
|
||
: If "Date" Input Type is chosen, you can enter a date format to use when selecting the date | ||
in the user interface. Using the [momentjs format](https://momentjs.com/docs/#/displaying/format/). | ||
|
||
Default Value | ||
|
||
: A Default Value will automatically be set for the option if it is not otherwise specified by the user, even if not specified among the arguments when executing a job via the command-line or API. Note that a blank value can be specified via the command-line or API, which will override the use of the Default Value. | ||
|
||
Allowed values | ||
|
||
|
@@ -136,7 +144,7 @@ popup menu. If set "false", a text field will also be presented. | |
Enter a regular expression in the "Match Regular Expression" | ||
field the Job will evaluate when run. | ||
|
||
Requirement | ||
Required | ||
|
||
: Indicates if the Job can only run if a non-blank value is provided for | ||
that Option. Choose "No" to indicate that a blank value is allowed, and | ||
|
@@ -166,7 +174,20 @@ Usage (see below) | |
|
||
 | ||
|
||
### Option timestamp variable | ||
|
||
#### Input Types | ||
|
||
For Text Option types, the Input Type defines how the text option is presented in the GUI, and how it is used when the Job executes. | ||
|
||
Input types: | ||
|
||
- "Plain" - a normal option which is shown in clear text | ||
|
||
- "Date" - A Date input which can produce a date string in a user-defined format. | ||
- "Plain Text with Password Input" - an option which is obscured at user input time, and the value of which is not stored in the database, but is exposed in scripts and commands. See [secure-options](#secure-options). | ||
- "Secure Remote Authentication" - a secure option which is used only for remote authentication and is not exposed in scripts or commands. See [secure-remote-authentication-options](#secure-remote-authentication-options). | ||
|
||
#### Option timestamp variable | ||
|
||
You can use the string `${DATE:format}` as a job option value (either as a default value or as input by the user), which will be converted when the job/command is executed. | ||
This variable also allows you to add or remove days as you can see below. | ||
|
@@ -199,6 +220,28 @@ The `option.NAME` variable will contain a unique ID identifying the uploaded fil | |
|
||
`file.NAME.sha` will be the SHA256 hash of the file. | ||
|
||
### Multiline Text Option Type | ||
|
||
:::betafeature Beta Feature (Since v5.17.0) | ||
|
||
To enable this feature, add the config `rundeck.feature.multilineJobOptions.enabled=true` | ||
::: | ||
|
||
|
||
Choose "Multiline Text" from the Option Type dropdown: | ||
|
||
 | ||
|
||
Default Value | ||
|
||
: Enter a multi-line string to use as a default value. | ||
|
||
Restrictions | ||
|
||
: Choose None, or "Match Regular Expression". If a Regular expression is used, be aware that for multiline input, the default behavior of the Java Pattern match will not match across multiple lines. You must use the "s" flag, which can be done by including `(?s)` in the regular expression. | ||
gschueler marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
|
||
## Script usage | ||
|
||
Option values can be passed to scripts as an argument or referenced | ||
|
@@ -221,9 +264,9 @@ forms to access the value of the "message" option. | |
|
||
```bash .numberLines | ||
#!/bin/sh | ||
echo envvar=$RD_OPTION_MESSAGE ;# access message as environment variable. | ||
echo args=$1 ;# read value passed into argument vector | ||
echo [email protected]@ ;# access message via replacement token syntax | ||
echo envvar="$RD_OPTION_MESSAGE" ;# access message as environment variable. | ||
echo args="$1" ;# read value passed into argument vector | ||
echo message="@option.message@" ;# access message via replacement token syntax | ||
``` | ||
|
||
When the user runs the "hello" job they will be prompted for the | ||
|
@@ -347,6 +390,8 @@ echo "$1" | |
|
||
Which allows the shell will correctly handle the input value by quoting it. | ||
|
||
Note: for Multiline Text options, some shells like Bash will not expand a variable with multiple lines exactly as it was entered, *unless* the variable is quoted. | ||
|
||
gschueler marked this conversation as resolved.
Show resolved
Hide resolved
|
||
### Using non-escaped values | ||
|
||
If the job needs to provide an option in its raw, unescaped form it is possible to use the `unquotedoption` context lookup key instead of `option`. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 beta feature callout is missing proper formatting and explanation. Consider adding more context about what this feature enables and any limitations or considerations for beta usage.
Copilot uses AI. Check for mistakes.