Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
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
3 changes: 2 additions & 1 deletion approved/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
headers:
x-api-key: <+secret.getValue("api_key")>
content-type: "application/json"
assertion: "expression"
assertion:
code: 200
body: |
identifier: "test"
name: "test"
Expand Down
168 changes: 168 additions & 0 deletions approved/pipeline/failure-strategy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# step with failure strategy

pipeline:
stages:
- steps:
- run:
script: go test
on-failure:
errors: all
action: ignore
---
# sample pipeline with a retry failure strategy
# that fails if all retry attempts fail.

pipeline:
stages:
- steps:
- run:
script: go test
container: golang
on-failure:
errors: [ unknown ]
action:
retry:
attempts: 5
interval: 10s
failure-action: fail

---

# sample pipeline with a retry failure strategy
# that demonstrates multiple, staggered intervals.

pipeline:
stages:
- steps:
- run:
script: go test
container: golang
on-failure:
errors: [ unknown ]
action:
retry:
attempts: 5
interval: [ 10s, 30s, 1m, 5m, 10m ]
failure-action: fail

---

# sample pipeline with retry failure strategy with a
# complex failure action.

pipeline:
stages:
- steps:
- run:
script: go test
container: golang
on-failure:
errors: [ unknown ]
action:
retry:
attempts: 5
interval: 10s
failure-action:
manual-intervention:
timeout: 60m
timeout-action: fail

---

# sample pipeline with simplified retry strategy
# syntax that should apply sane defaults.

pipeline:
stages:
- steps:
- run:
script: go test
container: golang
on-failure:
errors: all
action: retry

---

# sample pipeline with manual-intervention
# failure strategy that fails on timeout.

pipeline:
stages:
- steps:
- run:
script: go test
container: golang
on-failure:
errors: [ all ]
action:
manual-intervention:
timeout: 30m
timeout-action: fail

---

# sample pipeline with manual-intervention
# failure strategy with a complex timeout
# action.

pipeline:
stages:
- steps:
- run:
script: go test
container: golang
on-failure:
errors: [ all ]
action:
manual-intervention:
timeout: 30m
timeout-action:
retry:
attempts: 10
interval: 30s
failure-action: success
---

# sample pipeline with a basic failure strategy at the stage
# level that aborts on all errors.

pipeline:
stages:
- steps:
- run:
script: go test
container: golang
on-failure:
errors: all
action: abort

---

# sample pipeline with a basic failure strategy at the step
# level that aborts on all errors.

pipeline:
stages:
- steps:
- run:
script: go test
container: golang
on-failure:
errors: all
action: abort

---

# sample pipeline with a retry failure strategy
# that aborts for enumerated error types.

pipeline:
stages:
- steps:
- run:
script: go test
container: golang
on-failure:
errors: [ unknown, connectivity ]
action: abort
75 changes: 75 additions & 0 deletions approved/pipeline/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# sample pipeline with run step

pipeline:
stages:
- steps:
- run:
script: go build

---

# sample pipeline with run step, short syntax

pipeline:
stages:
- steps:
- run: go build

---

# sample pipeline with run step, shortest syntax

pipeline:
stages:
- steps:
- go build

---

# sample pipeline with conditional execution

pipeline:
if: ${{ branch == "main" }}
stages:
- steps:
- run:
script: go build

---

# sample pipeline with global envs

pipeline:
env:
GOOS: linux
GOARCH: amd64
stages:
- steps:
- go build

---

# sample pipeline with optional repository override

pipeline:
# repository should be optional. If undefined,
# the repository and conector are the same as
# where the yaml was stored.
repo:
name: drone/drone
connector: account.github
stages:
- steps:
- go build

---

# sample pipeline, github compatible

jobs:
test:
runs-on: ubuntu
steps:
- run: go build

---
Loading