use 'mdbci destroy' instead of 'vagrant destroy' (#163)

use mdbci destroy instead of vagrant destroy
This commit is contained in:
Timofey Turenko
2018-01-30 15:48:05 +02:00
committed by GitHub
parent 6068850b18
commit f9cc2d5bbb
6 changed files with 13 additions and 41 deletions

View File

@ -20,10 +20,8 @@ if [ "$product" == "mysql" ] ; then
export cnf_path=${script_dir}/cnf/mysql56
fi
${mdbci_dir}/mdbci destroy $name
mkdir -p ${MDBCI_VM_PATH}/$name
cd ${MDBCI_VM_PATH}/$name
vagrant destroy -f
cd $dir
mkdir ${MDBCI_VM_PATH}/$name/cnf
cp -r ${cnf_path}/* ${MDBCI_VM_PATH}/$name/cnf/

View File

@ -1,10 +0,0 @@
#!/bin/bash
dir=`pwd`
cd ${MDBCI_VM_PATH}/${name}
vagrant destroy -f
cd $dir
rm -rf ${MDBCI_VM_PATH}/${name}
rm -rf ${MDBCI_VM_PATH}/${name}.json
rm -rf ${MDBCI_VM_PATH}/${name}_network_config

View File

@ -63,7 +63,6 @@ res=$?
ulimit -c unlimited
if [ $res == 0 ] ; then
# . ${script_dir}/configure_backend.sh
. ${script_dir}/set_env.sh $name
cd ${script_dir}/..
cmake . -DBUILDNAME=$name -DCMAKE_BUILD_TYPE=Debug
@ -76,7 +75,7 @@ if [ $res == 0 ] ; then
if [ $? != 0 ]; then
echo "Backend broken!"
if [ "${do_not_destroy_vm}" != "yes" ] ; then
${script_dir}/destroy.sh
${mdbci_dir}/mdbci destroy $name
fi
rm ~/vagrant_lock
exit 1
@ -90,13 +89,13 @@ if [ $res == 0 ] ; then
else
echo "Failed to create VMs, exiting"
if [ "${do_not_destroy_vm}" != "yes" ] ; then
${script_dir}/destroy.sh
${mdbci_dir}/mdbci destroy $name
fi
rm ~/vagrant_lock
exit 1
fi
if [ "${do_not_destroy_vm}" != "yes" ] ; then
${script_dir}/destroy.sh
${mdbci_dir}/mdbci destroy $name
echo "clean up done!"
fi

View File

@ -48,15 +48,14 @@ export repo_dir=$dir/repo.d/
${mdbci_dir}/mdbci snapshot revert --path-to-nodes $name --snapshot-name $snapshot_name
if [ $? != 0 ]; then
${script_dir}/destroy.sh
${mdbci_dir}/mdbci destroy $name
${MDBCI_VM_PATH}/scripts/clean_vms.sh $name
${script_dir}/create_config.sh
checkExitStatus $? "Error creating configuration" $snapshot_lock_file
. ${script_dir}/configure_backend.sh
checkExitStatus $? "Error creating configuration" $snapshot_lock_file
echo "Creating snapshot from new config"
$HOME/mdbci/mdbci snapshot take --path-to-nodes $name --snapshot-name $snapshot_name
${mdbci_dir}/mdbci snapshot take --path-to-nodes $name --snapshot-name $snapshot_name
fi
. ${script_dir}/set_env.sh "$name"