Use the functions from functions.sh
This commit is contained in:
+4
-22
@@ -4,11 +4,12 @@
|
||||
|
||||
script_cmd=${0##*/}
|
||||
|
||||
. functions.sh
|
||||
declare -A all_series
|
||||
|
||||
all_series=(
|
||||
['debian']="images:debian/sid/cloud"
|
||||
['ubuntu']="ubuntu:resolute"
|
||||
['ubuntu']="ubuntu-daily:devel"
|
||||
)
|
||||
|
||||
project_name="deb-testing"
|
||||
@@ -86,32 +87,13 @@ ${lxc} profile edit default < lxd_profile_deb.yaml
|
||||
tar cfz /tmp/${prod}.tgz .
|
||||
cd -
|
||||
|
||||
echo -n "Checking VM status of ${inst_name} "
|
||||
|
||||
while true ; do
|
||||
num_of_procs=$(${lxc} info ${inst_name} | yq .Resources.Processes)
|
||||
[[ ${num_of_procs} -gt 0 ]] && break
|
||||
sleep 3
|
||||
echo -n "."
|
||||
done
|
||||
|
||||
echo " done"
|
||||
check_vm_status ${inst_name} ${project}
|
||||
|
||||
${lxc} exec ${inst_name} -- rm -rf /root/build
|
||||
${lxc} exec ${inst_name} -- mkdir -p /root/build
|
||||
${lxc} file push /tmp/${prod}.tgz ${inst_name}/root/build/${prod}.tgz
|
||||
|
||||
echo -n "Checking cloud-init status of ${inst_name} "
|
||||
|
||||
while true ; do
|
||||
status=$(${lxc_exec} ${inst_name} -- cloud-init status | grep status | awk '{print $2}')
|
||||
[[ "${status}" == "done" ]] && break
|
||||
[[ "${status}" == "error" ]] && break
|
||||
sleep 3
|
||||
echo -n "."
|
||||
done
|
||||
|
||||
echo " done"
|
||||
check_cloud_init_status ${inst_name} ${project}
|
||||
|
||||
if [[ ${fresh} != "true" ]] ; then
|
||||
${lxc_exec} ${inst_name} -- sudo apt update
|
||||
|
||||
Reference in New Issue
Block a user