File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
ci/images/ci-runner/hack/bin Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -39,8 +39,9 @@ open_bitwarden_session() {
39
39
fi
40
40
41
41
login_status=$( bw login --check 2>&1 )
42
- if [ " $login_status " = " You are not logged in." ]; then
43
- printf " Error while logging into Bitwarden.\n" >&2 | indent 2
42
+ echo " $login_status "
43
+ if [ ! " $login_status " = " You are logged in!" ]; then
44
+ printf ' Error while logging into Bitwarden: %s \n' " $login_status " >&2 | indent 2
44
45
return
45
46
fi
46
47
@@ -53,7 +54,18 @@ open_bitwarden_session() {
53
54
get_password () {
54
55
setx_off
55
56
local itemid=" $1 "
56
- password=$( bw get password " $itemid " --session " $session " )
57
+ local retry=0
58
+ echo " Fetching password from Bitwarden"
59
+ while ! password=$( bw get password " $itemid " --session " $session " 2> /dev/null) ; do
60
+ sleep 2
61
+ retry=$(( retry+ 1 ))
62
+ if [ " $retry " -eq 5 ]; then
63
+ printf " Error: passwords could not be retrieved.\n" >&2 | indent 2
64
+ exit 1
65
+ else
66
+ printf " Retrying...\n" | indent 2
67
+ fi
68
+ done
57
69
export password
58
70
setx_on
59
71
}
You can’t perform that action at this time.
0 commit comments