-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
76 additions
and
67 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<Details summary="Switching scripting language"> | ||
|
||
Use a shebang (`#!`) line to choose a different shell (`python`, `bash` and `pwsh` are included in the base image) | ||
|
||
```yaml | ||
exec: | ||
script: | | ||
//highlight-next-line | ||
#! pwsh | ||
Get-Items | ConvertTo-JSON | ||
``` | ||
</Details> | ||
<Details summary="Escaping templates in Helm Charts"> | ||
If you need to pass a template through a Helm Chart and prevent Helm from templating you need to escape it: | ||
``` | ||
{{`{{ .secret }}`}} | ||
``` | ||
|
||
Alternatively [change the templating delimiters](#changing-templating-delimiters) | ||
|
||
</Details> | ||
|
||
<Details summary="Multiline handling with YAML"> | ||
|
||
If you are using a YAML multiline string use `|` and not `>` which will strip newlines | ||
Check failure on line 29 in mission-control/docs/partials/_gotemplate.md GitHub Actions / vale[vale] mission-control/docs/partials/_gotemplate.md#L29
Raw output
Check failure on line 29 in mission-control/docs/partials/_gotemplate.md GitHub Actions / vale[vale] mission-control/docs/partials/_gotemplate.md#L29
Raw output
Check warning on line 29 in mission-control/docs/partials/_gotemplate.md GitHub Actions / vale[vale] mission-control/docs/partials/_gotemplate.md#L29
Raw output
|
||
|
||
Instead of: | ||
```yaml | ||
exec: | ||
//highlight-next-line | ||
script: > | ||
#! pwsh | ||
Get-Items | ConvertTo-JSON | ||
``` | ||
Do this: | ||
```yaml | ||
exec: | ||
//highlight-next-line | ||
script: | | ||
#! pwsh | ||
Get-Items | ConvertTo-JSON | ||
``` | ||
</Details> | ||
<Details summary="Changing templating delimiters"> | ||
The template delimiters can be changed from the defaults of `$()` and `{{}}` with `gotemplate` comments | ||
|
||
```yaml | ||
exec: | ||
script: | | ||
#! pwsh | ||
//highlight-next-line | ||
# gotemplate: left-delim=$[[ right-delim=]] | ||
$message = "$[[.config.name]]" | ||
Write-Host "{{ $message }}" | ||
Write-Host @{ Number = 1; Shape = "Square"; Color = "Blue"} | ConvertTo-JSON | ||
``` | ||
</Details> |
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