-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscrewdriver.yaml
37 lines (36 loc) · 2.02 KB
/
screwdriver.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# ----------------------------------------------------------------------------------------------------------------------
#
# shared
#
# ----------------------------------------------------------------------------------------------------------------------
shared:
image: centos:centos7
# ----------------------------------------------------------------------------------------------------------------------
#
# jobs
#
# ----------------------------------------------------------------------------------------------------------------------
jobs:
main:
requires: [ ~commit, ~pr ]
steps:
- success: |
function command() {
echo "SUCCESS"
return 0
}
{ command_output=$(command 2>&1); sdcmd_status="$?"; [ "$sdcmd_status" -ne 0 ] && { echo "$command_output" | grep -q 'ERROR: Screwdriver API 404 Not Found: Command sd/events@latest does not exist' || { echo "$command_output" && echo "Something wrong while sending events"; } } || echo "$command_output"; }
- failure: |
set +e
function command() {
echo "FAILED" >&2
return 1
}
{ command_output=$(command 2>&1); sdcmd_status="$?"; [ "$sdcmd_status" -ne 0 ] && { echo "$command_output" | grep -q 'ERROR: Screwdriver API 404 Not Found: Command sd/events@latest does not exist' || { echo "$command_output" && echo "Something wrong while sending events"; } } || echo "$command_output"; }
- failure-with-sd-cmd-not-found: |
set +e
function command() {
echo "ERROR: Screwdriver API 404 Not Found: Command sd/events@latest does not exist" >&2
return 1
}
{ command_output=$(command 2>&1); sdcmd_status="$?"; [ "$sdcmd_status" -ne 0 ] && { echo "$command_output" | grep -q 'ERROR: Screwdriver API 404 Not Found: Command sd/events@latest does not exist' || { echo "$command_output" && echo "Something wrong while sending events"; } } || echo "$command_output"; }