File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ Changelog
4
4
in development
5
5
--------------
6
6
7
+ Changed
8
+ ~~~~~~~~~
9
+ * Improve the st2-self-check script to echo to stderr and exit if it isn't run with a
10
+ ST2_AUTH_TOKEN or ST2_API_KEY environment variable. (improvement) #5068
7
11
8
12
3.3.0 - October 06, 2020
9
13
------------------------
Original file line number Diff line number Diff line change @@ -57,7 +57,14 @@ shift $(($OPTIND-1))
57
57
58
58
# # Script to install samples, tests, and run all workflows in tests pack.
59
59
if [[ ` id -u` != 0 ]]; then
60
- echo " st2-self-check must be run as root"
60
+ echo >&2 " st2-self-check must be run as root"
61
+ exit 1
62
+ fi
63
+
64
+ if [[ -z " $ST2_AUTH_TOKEN " && -z " $ST2_API_KEY " ]]; then
65
+ echo >&2 " st2-self-check must be run with an auth token or API key in an environment variable"
66
+ echo >&2 " Please export a valid auth token in ST2_AUTH_TOKEN or a valid API key in ST2_API_KEY"
67
+ echo >&2 " and re-run st2-self-check"
61
68
exit 1
62
69
fi
63
70
@@ -89,7 +96,7 @@ git clone --depth 1 --branch ${ST2_TESTS_BRANCH} https://github.com/StackStorm/s
89
96
EXIT_CODE=$?
90
97
91
98
if [ ${EXIT_CODE} -ne 0 ]; then
92
- echo " Failed to clone st2tests repo"
99
+ echo >&2 " Failed to clone st2tests repo"
93
100
exit 1
94
101
fi
95
102
You can’t perform that action at this time.
0 commit comments