-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inject variables using true or _cast_ types when variable references not embedded in other text. Consider: ``` metadata: provider: address: localhost:$(PORT) initConfig: - providerSpecificConfig: mavenInsecure: $(maven.insecure) mavenSettingsFile: $(maven.settings.path) name: java resources: - selector: identity:kind=maven fields: - key: maven.settings.path name: settings path: /shared/creds/maven/settings.xml - selector: setting:key=mvn.insecure.enabled fields: - key: maven.insecure name: value ``` For example: ``` mavenInsecure = $(maven.insecure) ``` $(maven.insecure) has a _true_ type of boolean (as stored in the db) so it will be injected as: ```yaml mavenInsecure: true ``` For cases when the _true_ type is different, an optional `type` field may be used to cast. In the previous example, if maven.insecure was stored as a string "true" but need to be injected as a boolean, the type field may be used. ``` - selector: setting:key=mvn.insecure.enabled fields: - key: maven.insecure name: value type: boolean ``` While we're at it, (and to help with testing), support for _default_ values added. ``` - selector: setting:key=mvn.insecure.enabled fields: - key: maven.insecure name: value type: boolean default: false ``` --------- Signed-off-by: Jeff Ortel <[email protected]> (cherry picked from commit 5e4a70d)
- Loading branch information
Showing
2 changed files
with
247 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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