Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Paste
P226
(An Untitled Masterwork)
Active
Public
Actions
Authored by
seirl
on Feb 16 2018, 2:37 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
diff --git a/bin/deploy-on b/bin/deploy-on
index 46d18e0..8e86207
100755
--- a/bin/deploy-on
+++ b/bin/deploy-on
@@ -29,12 +29,16 @@ die_usage
()
{
ssh_or_die
()
{
host
=
"
$1
"
cmd
=
"
$2
"
+
allowed_return_codes
=
"
${
3
:-
0
}
"
$SSH
"
$host
"
"
$cmd
"
ret
=
"
$?
"
-
if
[
"
$ret
"
-ne
"0"
]
;
then
- info
"An error occured while deploying on
$host
. Exiting."
-
exit
"
$ret
"
-
fi
+
for
allowed_ret in
${
allowed_return_codes
}
;
do
+
if
[
"
$ret
"
-eq
"
$allowed_ret
"
]
;
then
+
return
0
+
fi
+
done
+ info
"An error occured while deploying on
$host
. Exiting."
+
exit
"
$ret
"
}
# command line parsing
@@ -65,7 +69,7 @@ deploy_on_host
()
{
info
"deploying on
${
host
}
..."
- ssh_or_die
"
$host
"
"sudo /usr/local/sbin/swh-puppet-apply"
+ ssh_or_die
"
$host
"
"sudo /usr/local/sbin/swh-puppet-apply"
"0 2"
info
"deployment ok. Bye."
}
Event Timeline
seirl
created this paste.
Feb 16 2018, 2:37 PM
2018-02-16 14:37:58 (UTC+1)
Log In to Comment