Commit 515290bf authored by Bob Mottram's avatar Bob Mottram

Synchronous builds

parent bb667e04
......@@ -38,10 +38,11 @@ EMAIL_ADDRESS=
XMPP_ADDRESS=
COPY_IMAGES=
RUN_AS_ROOT=
SYNCHRONOUS=
function show_help {
echo ''
echo $"${APP_NAME} -d [directory] --repo [git repo url] --branch [branch] --script [build script] --install [daemon name] -w [html file] --remove [daemon name] --header [text] -e [email address] --images [yes|no] --root [yes|no] --xmpp [adminJID]"
echo $"${APP_NAME} -d [directory] --repo [git repo url] --branch [branch] --script [build script] --install [daemon name] -w [html file] --remove [daemon name] --header [text] -e [email address] --images [yes|no] --root [yes|no] --xmpp [adminJID] --synchronous [yes|no]"
echo ''
exit 0
}
......@@ -162,6 +163,15 @@ function create_web_page {
}
function update {
if [[ "$SYNCHRONOUS" == 'y'* || "$SYNCHRONOUS" == '1' || "$SYNCHRONOUS" == 'on' ]]; then
# shellcheck disable=SC2009
existing_builds=$(ps aux | grep "birbci -d" | grep -vc "grep")
# shellcheck disable=SC2086
if [ $existing_builds -gt 1 ]; then
return
fi
fi
# If the repo isn't cloned then do that now
if [ ! -d "$BUILD_DIR" ]; then
if ! git clone "$REPO" "$BUILD_DIR"; then
......@@ -348,6 +358,10 @@ case $key in
shift
RUN_AS_ROOT="$1"
;;
--synchronous|--noparallel)
shift
SYNCHRONOUS="$1"
;;
*)
# unknown option
;;
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment