Skip to content
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

Added shell support #5

Merged
merged 16 commits into from
Nov 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
📝 updating readme
  • Loading branch information
Rohland committed Nov 15, 2023
commit ea015d94cc4d8425353757153be7876f6632cd5c
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -361,16 +361,16 @@ The example below demonstrates how to run a custom shell script.
```yaml
shell:
my-script:
timeout: 5s # defaults to 10 seconds
name: my-script
path: ./my-script.sh # relative to current yaml file (or absolute path)
responseType: json
triggers:
- rules:
- expression: "exitCode !== 0"
message: "Script failed with exit code {{exitCode}}"
- expression: failed_requests > 0
message: "Failed requests was {{ failed_requests }}"
timeout: 5s # defaults to 10 seconds
name: my-script
path: ./my-script.sh # relative to current yaml file (or absolute path)
responseType: json
triggers:
- rules:
- expression: "exitCode !== 0"
message: "Script failed with exit code {{exitCode}}"
- expression: failed_requests > 0
message: "Failed requests was {{ failed_requests }}"
```

Supported response types:
@@ -385,17 +385,17 @@ A more complex example:
```yaml
shell:
validate-country-$1:
vary-by: [za,us,gb]
path: ./my-script.sh # the vary-by params are passed into the script as arguments, i.e. ./script.sh $1 $2
responseType: json
identifier: id
triggers:
- match: .* # catch all (you can match on the identifier field in the result set, and if missing or not set, the vary-by value will be used here (identifier is pipe delimited if multipart))
rules:
- expression: "exitCode !== 0"
message: "Script failed with exit code {{exitCode}}"
- expression: my_field > 0
message: "Failed requests was {{ failed_requests }}"
vary-by: [za,us,gb]
path: ./my-script.sh # the vary-by params are passed into the script as arguments, i.e. ./script.sh $1 $2
responseType: json
identifier: id
triggers:
- match: .* # catch all (you can match on the identifier field in the result set, and if missing or not set, the vary-by value will be used here (identifier is pipe delimited if multipart))
rules:
- expression: "exitCode !== 0"
message: "Script failed with exit code {{exitCode}}"
- expression: my_field > 0
message: "Failed requests was {{ failed_requests }}"
```

---