Code Review
/
releng
/
builder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Use larger heap size for distribution SFT"
[releng/builder.git]
/
jjb
/
opendaylight-infra-copy-ssh-keys.sh
diff --git
a/jjb/opendaylight-infra-copy-ssh-keys.sh
b/jjb/opendaylight-infra-copy-ssh-keys.sh
index 2b2267786d357a08ba0843c8b1b6d9d822b1ac6d..7e3d8b0caf78f062f66d04d200e38ad223c74ef0 100644
(file)
--- a/
jjb/opendaylight-infra-copy-ssh-keys.sh
+++ b/
jjb/opendaylight-infra-copy-ssh-keys.sh
@@
-1,16
+1,18
@@
#!/bin/bash
echo "----------> Copy ssh public keys to csit lab"
#!/bin/bash
echo "----------> Copy ssh public keys to csit lab"
-source $WORKSPACE/.venv-openstack/bin/activate
+# shellcheck source=/tmp/v/openstack/bin/activate disable=SC1091
+source "/tmp/v/openstack/bin/activate"
function copy-ssh-keys-to-slave() {
RETRIES=60
for j in $(seq 1 $RETRIES); do
function copy-ssh-keys-to-slave() {
RETRIES=60
for j in $(seq 1 $RETRIES); do
+ # shellcheck disable=SC2092
if `ssh-copy-id -i /home/jenkins/.ssh/id_rsa.pub "jenkins@${i}" > /dev/null 2>&1`; then
if `ssh-copy-id -i /home/jenkins/.ssh/id_rsa.pub "jenkins@${i}" > /dev/null 2>&1`; then
- ssh
jenkins@${i}
'echo "$(facter ipaddress_eth0) $(/bin/hostname)" | sudo tee -a /etc/hosts'
+ ssh
"jenkins@${i}"
'echo "$(facter ipaddress_eth0) $(/bin/hostname)" | sudo tee -a /etc/hosts'
echo "Successfully copied public keys to slave ${i}"
break
echo "Successfully copied public keys to slave ${i}"
break
- elif [
$j
-eq $RETRIES ]; then
+ elif [
"$j"
-eq $RETRIES ]; then
echo "SSH not responding on ${i} after $RETIRES tries. Giving up."
exit 1
else
echo "SSH not responding on ${i} after $RETIRES tries. Giving up."
exit 1
else
@@
-19,7
+21,7
@@
function copy-ssh-keys-to-slave() {
fi
# ping test to see if connectivity is available
fi
# ping test to see if connectivity is available
- if ping -c1
${i}
&> /dev/null; then
+ if ping -c1
"${i}"
&> /dev/null; then
echo "Ping to ${i} successful."
else
echo "Ping to ${i} failed."
echo "Ping to ${i} successful."
else
echo "Ping to ${i} failed."
@@
-29,9
+31,10
@@
function copy-ssh-keys-to-slave() {
# Print the Stack outputs parameters so that we can identify which IPs belong
# to which VM types.
# Print the Stack outputs parameters so that we can identify which IPs belong
# to which VM types.
-openstack
--os-cloud rackspace stack show -c outputs $STACK_NAME
+openstack
stack show -c outputs "$STACK_NAME"
-ADDR=(`openstack --os-cloud rackspace stack show -f json -c outputs $STACK_NAME | \
+# shellcheck disable=SC2006
+ADDR=(`openstack stack show -f json -c outputs "$STACK_NAME" | \
jq -r '.outputs[] | \
select(.output_key | match("^vm_[0-9]+_ips\$")) | \
.output_value | .[]'`)
jq -r '.outputs[] | \
select(.output_key | match("^vm_[0-9]+_ips\$")) | \
.output_value | .[]'`)
@@
-44,7
+47,7
@@
done
# Detect when a process failed to copy ssh keys and fail build
for p in $pids; do
# Detect when a process failed to copy ssh keys and fail build
for p in $pids; do
- if wait
$p
; then
+ if wait
"$p"
; then
echo "Process $p successfully copied ssh keys."
else
echo "Process $p failed to copy ssh keys."
echo "Process $p successfully copied ssh keys."
else
echo "Process $p failed to copy ssh keys."