Skip to content

Commit f822541

Browse files
committed
Refactored initialize-build-host to support proxy-target.txt in current directory instead of $HOME for greater flexibility
This enables us to use one account on a proxy host to connect to many different hosts. Ticket: ENT-13765 Changelog: none
1 parent b7be856 commit f822541

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

ci/initialize-build-host.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# serial execution of initialization steps. It will post the output when
99
# finished, if any.
1010
#
11-
# 2. If $HOME/proxy-target.txt exists, it means this is a proxy host, and the
11+
# 2. If $(pwd)/proxy-target.txt exists, it means this is a proxy host, and the
1212
# real build machine is on the host specified by the login details inside
1313
# that file. If the file does not exist, we are on the build slave itself.
1414
# After figuring that stuff out, this script will run either on_proxy() or
@@ -224,14 +224,14 @@ reset_nested_vm() {
224224
fi
225225
if [ ! -z "$login" ]
226226
then
227-
ip=`sed 's/.*@//' $HOME/proxy-target.txt`
227+
ip=`sed 's/.*@//' $(pwd)/proxy-target.txt`
228228
if sudo arp | grep -q $ip
229229
then
230230
sudo arp -d $ip
231231
fi
232232
fi
233233
$HOME/mender-qa/scripts/nested-vm.sh $HOME/*.qcow2
234-
login="`cat $HOME/proxy-target.txt`"
234+
login="`cat $(pwd)/proxy-target.txt`"
235235
if $RSH $login true
236236
then
237237
echo "Nested VM is back up, it seems. Happily continuing!"
@@ -273,7 +273,7 @@ reset_nested_vm() {
273273
fi
274274
}
275275

276-
if [ -f $HOME/proxy-target.txt ]
276+
if [ -f $(pwd)/proxy-target.txt ]
277277
then
278278
ret=0
279279
on_proxy || ret=$?
@@ -288,7 +288,7 @@ then
288288
# Check target machine health.
289289
# --------------------------------------------------------------------------
290290

291-
login="$(cat $HOME/proxy-target.txt)"
291+
login="$(cat $(pwd)/proxy-target.txt)"
292292

293293
if [ ! -z "$login" ] && $RSH $login true
294294
then

0 commit comments

Comments
 (0)