Examples
::: {.contents local=""} :::
name: hello world
steps:
- name: s1
command: echo hello world
- name: s2
command: echo done!
depends:
- s1
params: foo
steps:
- name: step1
command: echo start
- name: foo
command: echo foo
depends:
- step1
preconditions:
- condition: "$1"
expected: foo
- name: bar
command: echo bar
depends:
- step1
preconditions:
- condition: "$1"
expected: bar
steps:
- name: write hello to '/tmp/hello.txt'
command: echo hello
stdout: /tmp/hello.txt
steps:
- name: pass 'hello'
command: echo hello
output: OUT1
- name: output 'hello world'
command: bash
script: |
echo $OUT1 world
depends:
- pass 'hello'
steps:
- name: deno_hello_world
executor:
type: docker
config:
image: "denoland/deno:1.10.3"
host:
autoRemove: true
command: run https://examples.deno.land/hello-world.ts
See docker executor
{.interpreted-text role=“ref”} for more details.
steps:
- name: get fake json data
executor: http
command: GET https://jsonplaceholder.typicode.com/comments
script: |
{
"timeout": 10,
"headers": {},
"query": {
"postId": "1"
},
"body": ""
}
steps:
- name: run query
executor: jq
command: '{(.id): .["10"].b}'
script: |
{"id": "sample", "10": {"b": 42}}
Expected Output:
{
"sample": 42
}
steps:
- name: format json
executor: jq
script: |
{"id": "sample", "10": {"b": 42}}
Expected Output:
{
"10": {
"b": 42
},
"id": "sample"
}
steps:
- name: output raw value
executor:
type: jq
config:
raw: true
command: '.id'
script: |
{"id": "sample", "10": {"b": 42}}
Expected Output:
sample
steps:
- name: Sending Email on Finish or Error
command: echo "hello world"
mailOn:
failure: true
success: true
smtp:
host: "smtp.foo.bar"
port: "587"
username: "<username>"
password: "<password>"
errorMail:
from: "[email protected]"
to: "[email protected]"
prefix: "[Error]"
infoMail:
from: "[email protected]"
to: "[email protected]"
prefix: "[Info]"
smtp:
host: "smtp.foo.bar"
port: "587"
username: "<username>"
password: "<password>"
steps:
- name: step1
executor:
type: mail
config:
to: <to address>
from: <from address>
subject: "Sample Email"
message: |
Hello world
steps:
- name: step1
command: bash
script: |
for s in {1..64}; do trap "echo trap $s" $s; done
sleep 60
signalOnStop: "SIGINT"