-
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 #62 from davidovich/davidovich/issue61
breaking: improve rendering algorithm of commands
- Loading branch information
Showing
8 changed files
with
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,6 +81,8 @@ The `assets/summon.config.yaml` is an (optional) configuration file to customize | |
* default output-dir | ||
* executables | ||
|
||
> Breaking in v0.11.0: Handles now take an array of params | ||
```yaml | ||
version: 1 | ||
outputdir: .summoned | ||
|
@@ -94,18 +96,18 @@ exec: | |
bash -c: | ||
# ^ invoker | ||
# (script can be inlined with | yaml operator) | ||
hello: echo hello | ||
hello: [echo, hello] | ||
# ^ optional params that will be passed to invoker | ||
# these can contain templates (in v0.10.0) | ||
# ^ handle to script (must be unique). This is what you use | ||
# to invoke the script: `summon run hello`. | ||
|
||
gobin -run: # go gettable executables | ||
gobin: github.com/myitcv/[email protected] | ||
gohack: github.com/rogppepe/gohack | ||
gobin: [github.com/myitcv/[email protected]] | ||
gohack: [github.com/rogppepe/gohack] | ||
|
||
python -c: | ||
hello-python: print("hello from python!") | ||
hello-python: [print("hello from python!")] | ||
``` | ||
You can invoke executables like so: | ||
|
@@ -230,7 +232,7 @@ in the config file: | |
... | ||
exec: | ||
docker run -v {{ env "PWD" }}:/mounted-app alpine ls: | ||
list: /mounted-app | ||
list: [/mounted-app] | ||
``` | ||
Calling `summon run list` would render the [{{ env "PWD" }}](https://masterminds.github.io/sprig/os.html) part to the current directory, resulting in this call: | ||
|
@@ -245,7 +247,7 @@ invocable (new in v.0.10.0). You would use the `summon` template function bundle | |
```yaml | ||
exec: | ||
bash -c: | ||
hello: '{{ summon "hello.sh" }}' | ||
hello: ['{{ summon "hello.sh" }}'] | ||
``` | ||
|
||
Assuming you have a `hello.sh` file in the assets repo, this would result in sommoning the file in a temp dir and calling the invoker: | ||
|
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 |
---|---|---|
|
@@ -5,10 +5,12 @@ aliases: | |
outputdir: "overridden_dir" | ||
exec: | ||
bash: | ||
echo: echo hello {{ .Name -}} | ||
hello-bash: hello.sh | ||
echo: | ||
- echo | ||
- hello {{ .Name -}} | ||
hello-bash: [hello.sh] | ||
gobin -run: | ||
gobin: github.com/myitcv/[email protected] | ||
gohack: github.com/rogpeppe/gohack | ||
gobin: [github.com/myitcv/[email protected]] | ||
gohack: [github.com/rogpeppe/gohack] | ||
python -c: | ||
hello: print("hello from python!") | ||
hello: [print("hello from python!")] |
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 |
---|---|---|
|
@@ -5,12 +5,12 @@ aliases: | |
outputdir: "overridden_dir" | ||
exec: | ||
bash: | ||
hello-bash: hello.sh | ||
bash-self-ref: '{{ summon "hello.sh" }}' | ||
hello-bash: [ hello.sh ] | ||
bash-self-ref: ['{{ summon "hello.sh" }}'] | ||
docker {{ lower "INFO" }}: # template example | ||
docker: | ||
gobin -run: | ||
gobin: github.com/myitcv/[email protected] | ||
gohack: github.com/rogpeppe/gohack | ||
gobin: [github.com/myitcv/[email protected]] | ||
gohack: [github.com/rogpeppe/gohack] | ||
python -c: | ||
hello: print("hello from python!") | ||
hello: ['print("hello from python!")'] |