Remove vagrant lock from build.sh and run_test.sh (#190)

vagrant_lock was created in order to prevent parallel execution of two 'Vagrant up' operations in parallel. Previously it was necessary due to Vagrant internal Chef issue. Now several bugs in Vagrant are fixed and MDBCI uses own Chef to provision nodes for builds and tests. There is no need to wait for previous Vagrant run finished, removing all waiting from all scripts.
'rm vagrant_lock is still present to remove locks created by previous versions of build and test scripts-
This commit is contained in:
Timofey Turenko
2019-02-25 14:22:32 +02:00
committed by GitHub
parent 2440b48ccc
commit b0efcea3f6
6 changed files with 6 additions and 44 deletions

View File

@ -63,13 +63,6 @@ if [ "$already_running" != "ok" ]; then
$(<${script_dir}/templates/build.json.template)
" 2> /dev/null > $MDBCI_VM_PATH/${name}.json
while [ -f ~/vagrant_lock ]
do
sleep 5
done
touch ~/vagrant_lock
echo $JOB_NAME-$BUILD_NUMBER >> ~/vagrant_lock
# starting VM for build
echo "Generating build VM template"
${mdbci_dir}/mdbci --override --template $MDBCI_VM_PATH/$name.json generate $name
@ -77,7 +70,6 @@ $(<${script_dir}/templates/build.json.template)
${mdbci_dir}/mdbci up --attempts=1 $name
if [ $? != 0 ] ; then
echo "Error starting VM"
rm ~/vagrant_lock
exit 1
fi
echo "copying public keys to VM"
@ -92,9 +84,6 @@ export sshkey=`${mdbci_dir}/mdbci show keyfile $name/build --silent 2> /dev/null
export scpopt="-i $sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectTimeout=120 "
export sshopt="$scpopt $sshuser@$IP"
echo "Release Vagrant lock"
rm ~/vagrant_lock
echo "Starting build"
${script_dir}/remote_build.sh
export build_result=$?

View File

@ -21,13 +21,6 @@ eval "cat <<EOF
$(<${script_dir}/templates/install.json.template)
" 2> /dev/null > $MDBCI_VM_PATH/${name}.json
while [ -f ~/vagrant_lock ]
do
sleep 5
done
touch ~/vagrant_lock
echo $JOB_NAME-$BUILD_NUMBER >> ~/vagrant_lock
# destroying existing box
if [ -d "install_$box" ]; then
${mdbci_dir}/mdbci destroy $name
@ -42,12 +35,12 @@ if [ $? != 0 ] ; then
if [ "x$do_not_destroy_vm" != "xyes" ] ; then
${mdbci_dir}/mdbci destroy $name
fi
rm ~/vagrant_lock
rm -f ~/vagrant_lock
exit 1
fi
fi
rm ~/vagrant_lock
rm -f ~/vagrant_lock
# get VM info
export sshuser=`${mdbci_dir}/mdbci ssh --command 'whoami' --silent $name/maxscale 2> /dev/null | tr -d '\r'`