Skip to content
Snippets Groups Projects
Commit 9a47d597 authored by Bob Mottram's avatar Bob Mottram
Browse files

Reboot on image build fail

parent e4f4b93d
No related branches found
No related tags found
No related merge requests found
......@@ -39,6 +39,16 @@ if [ "$2" ]; then
build_info="$3"
fi
function check_for_reboot {
filename="$1"
if [ ! -f "$filename" ]; then
return
fi
if grep -q "AppException: command failed: ['mkfs'" "$filename"; then
systemctl reboot -i
fi
}
function remove_ci_daemon {
ci_target="$1"
ci_build_info="$2"
......@@ -188,16 +198,19 @@ build_log_filename="${web_dir}/buildlog_${PROJECT_NAME}-${targetstr}.txt"
cd "${build_directory}" || exit 1
if [ ! "$build_info" ]; then
if ! /usr/local/bin/${PROJECT_NAME}-image -t "${target}" ${extra} --ci yes --build-log "${build_log_filename}"; then
check_for_reboot "${build_log_filename}"
exit 10
fi
else
if [[ "$build_info" == 'onion' ]]; then
if ! /usr/local/bin/${PROJECT_NAME}-image -t "${target}" ${extra} --onion yes --ci yes --build-log "${build_log_filename}"; then
check_for_reboot "${build_log_filename}"
exit 20
fi
fi
if [[ "$build_info" == 'mesh'* ]]; then
if ! /usr/local/bin/${PROJECT_NAME}-image -t "${target}" -v "${build_info}" ${extra} --ci yes --build-log "${build_log_filename}"; then
check_for_reboot "${build_log_filename}"
exit 30
fi
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment