-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathentrypoint.sh
executable file
·94 lines (89 loc) · 2.33 KB
/
entrypoint.sh
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/sh
PARSED_ARGUMENTS=$(
getopt \
-o g:b:p:u:s:t:m:r:l:i:f:c:d:r:q:n: \
--long results-glob:,bucket:,prefix:,update-pr:,summary:,summary-table-type:,collapse-summary:,report-title:,copy-latest:,ignore-missing-results:,flaky-warning-status:,color:,debug:,base-url:,parallel:,report-name: \
-- "$@"
)
eval set -- "$PARSED_ARGUMENTS"
while :; do
case "$1" in
-g | --results-glob)
glob="$1='$2'"
shift 2
;;
-b | --bucket)
bucket="$1=$2"
shift 2
;;
-p | --prefix)
[ "$2" != "" ] && prefix="$1=$2"
shift 2
;;
-r | --base-url)
[ "$2" != "" ] && base_url="$1=$2"
shift 2
;;
-u | --update-pr)
[ "$2" != "" ] && updatePr="$1=$2"
shift 2
;;
-s | --summary)
[ "$2" != "" ] && summary="$1=$2"
shift 2
;;
-t | --summary-table-type)
[ "$2" != "" ] && table_type="$1=$2"
shift 2
;;
-m | --collapse-summary)
[ "$2" == "true" -o "$2" == "1" ] && collapse_summary="$1"
shift 2
;;
-r | --report-title)
[ "$2" == "true" -o "$2" == "1" ] && report_title="$1"
shift 2
;;
-l | --copy-latest)
[ "$2" == "true" -o "$2" == "1" ] && copy_latest="$1"
shift 2
;;
-i | --ignore-missing-results)
[ "$2" == "true" -o "$2" == "1" ] && ignore_missing="$1"
shift 2
;;
-f | --flaky-warning-status)
[ "$2" == "true" -o "$2" == "1" ] && flaky_warning_title="$1"
shift 2
;;
-c | --color)
[ "$2" == "true" -o "$2" == "1" ] && color="$1"
shift 2
;;
-d | --debug)
[ "$2" == "true" -o "$2" == "1" ] && debug="$1"
shift 2
;;
-q | --parallel)
[ "$2" == "true" -o "$2" == "1" ] && parallel="$1"
shift 2
;;
-n | --report-name)
[ "$2" == "true" -o "$2" == "1" ] && report_name="$1"
shift 2
;;
# -- means the end of the arguments; drop this, and break out of the while loop
--)
shift
break
;;
*)
echo "Unexpected option provided: '$1'"
exit 2
;;
esac
done
args="upload $@ ${glob} ${bucket} ${prefix} ${base_url} ${updatePr} ${summary} ${table_type} ${collapse_summary} ${report_title} ${copy_latest} ${ignore_missing} ${flaky_warning_title} ${color} ${debug} ${parallel} ${report_name}"
trimmed_args=$(echo ${args} | awk '{$1=$1};1')
echo "Running allure-report-publisher with arguments: '${trimmed_args}'"
eval "allure-report-publisher ${trimmed_args}"