-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from wild-devops/develop
v1.5.0
- Loading branch information
Showing
101 changed files
with
2,937 additions
and
956 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
*.log | ||
*.log.json | ||
.*/ | ||
*.xml |
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
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,39 @@ | ||
## `filters:` **element** | ||
|
||
**Optional** | ||
|
||
Contains definitions of small functions that will be loaded into the **PWSHAKE** execution context. | ||
|
||
These functions will be used into the **PWSHAKE** processing as attributes interpolators or helpers. | ||
|
||
Added functions are actually of the **Powershell** `filter` type, so they have some peculiarities: | ||
|
||
* have to take the first argument from **Powershell** pipeline | ||
* have the only `process` stage (block) in **Powershell** execution | ||
* have the first argument taken from pipeline is referred as `$_` variable in the `process` stage (block) | ||
|
||
Example: | ||
``` | ||
PS>cat pwshake.yaml | ||
attributes: | ||
my_attr: '{{$capsed:my_attr_value}}' | ||
sq_braced: '{{$("{{my_attr}}" | sq-braced)}}' | ||
filters: | ||
f-$capsed: |- | ||
{ "$_".ToUpper() } | ||
sq-braced: |- | ||
{ "[$_]" } | ||
... | ||
``` | ||
``` | ||
PS>Invoke-pwshake | ||
PWSHAKE config: | ||
attributes: | ||
my_attr: MY_ATTR_VALUE | ||
sq_braced: '[MY_ATTR_VALUE]' | ||
... | ||
``` | ||
|
||
Note that if the filter name starts with `f-$` chars it could be used to interpolate attributes. | ||
|
||
In this case the text following of `:` is passed to the filter as the first argument and result of the filter execution is substituted as the attribute value. |
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
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,14 @@ | ||
attributes: | ||
pwshake_verbosity: Normal | ||
hello_to: PWSHAKE | ||
on_error: continue | ||
pwshake_log_to_json: true | ||
|
||
tasks: | ||
say_hello: | ||
- echo: "Hello {{hello_to}}!" | ||
- pwsh: throw '{{hello_to}} is sick!' | ||
on_error: '{{on_error}}' | ||
|
||
invoke_tasks: | ||
- say_hello |
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
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
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,35 @@ | ||
attributes: | ||
context: | ||
Key: PWSHAKE | ||
Value: '[[.Key]]' | ||
Files: | ||
- '[[.Key]].txt' | ||
- '[[.Key]].log' | ||
- '[[.Key]].key' | ||
ListOfFiles: '[[$("$($_.Files)")]]' | ||
AppService: | ||
Locations: '[[.Files]]' | ||
Executable: '[[.Key]]\[[.Value]].exe' | ||
|
||
tasks: | ||
context: | ||
- echo: 'Hello {{context.Key}}!' | ||
- pwsh: |- | ||
$result = $config.attributes.context | Interpolate-Item | ConvertTo-Yaml | ||
Write-Host "`$result`:`n$result" | ||
if ($result -notmatch 'ListOfFiles: PWSHAKE\.txt PWSHAKE\.log PWSHAKE\.key') { | ||
throw 'Something wrong!' | ||
} | ||
- each: | ||
items: $[[$config.attributes.context]] | ||
action: | ||
invoke_steps: | ||
- pwsh: |- | ||
$result = '[[.Key]] files: [[.ListOfFiles]]' | ||
Write-Host "`$result = '$result'" | ||
if ($result -notmatch 'PWSHAKE files: PWSHAKE\.txt PWSHAKE\.log PWSHAKE\.key') { | ||
throw 'Something wrong!' | ||
} | ||
invoke_tasks: | ||
- context |
Oops, something went wrong.