...
 
Commits (2)
......@@ -39,7 +39,7 @@ XMPP_ADDRESS=
COPY_IMAGES=
SYNCHRONOUS=
USE_BUILD_LOG=no
UPDATE_SEC=600
UPDATE_SEC=300
function create_daemon {
daemon="$1"
......@@ -230,7 +230,7 @@ function create_web_page {
end_date=$(grep "end:" "$results" | sed 's|end:||g')
# shellcheck disable=SC2001
test_dir=$(echo "$d" | sed 's|/||g')
CURR_COMMIT=$(grep "head:" "$results" | awk -F ':' '{print $2}')
CURR_COMMIT=$(grep "head:" "$results" | awk -F ':' '{print $2}' | tr -d '[:space:]')
# get the colour corresponding to the build status
text_color='green'
......@@ -240,7 +240,7 @@ function create_web_page {
fi
if [[ "$status" == 'fail'* ]]; then
text_color='red'
last_good_commit=$(grep "commit:" "$results" | awk -F ':' '{print $2}')
last_good_commit=$(grep "commit:" "$results" | awk -F ':' '{print $2}' | tr -d '[:space:]')
if [ "$last_good_commit" ]; then
if [[ "$last_good_commit" != "$CURR_COMMIT" ]]; then
last_good_commit_str="<br><font color=\"green\">$last_good_commit</font>"
......@@ -319,7 +319,7 @@ function update {
git pull
# Get the current commit for the head of the repo
CURR_COMMIT=$(git log -n 1 | grep commit | awk -F ' ' '{print $2}')
CURR_COMMIT=$(git log -n 1 | grep commit | awk -F ' ' '{print $2}' | tr -d '[:space:]')
# No build is currently in progress
PREV_COMMIT=
......@@ -328,7 +328,7 @@ function update {
if [ -f $BIRB_FILE ]; then
# Get the last commit for which a build was attempted
LAST_COMMIT_TRIED=$(grep 'last:' $BIRB_FILE | awk -F ':' '{print $2}')
LAST_COMMIT_TRIED=$(grep 'last:' $BIRB_FILE | awk -F ':' '{print $2}' | tr -d '[:space:]')
# If this is the same as the current head then do nothing
if [[ "$LAST_COMMIT_TRIED" == "$CURR_COMMIT" ]]; then
......@@ -337,7 +337,7 @@ function update {
fi
# Get the currently in progress build commit
PREV_COMMIT=$(grep 'commit:' $BIRB_FILE | awk -F ':' '{print $2}')
PREV_COMMIT=$(grep 'commit:' $BIRB_FILE | awk -F ':' '{print $2}' | tr -d '[:space:]')
fi
# If the currently in progress build is the head then do nothing
......@@ -368,7 +368,7 @@ function update {
else
# create a new results file for this app
{ echo "commit:";
echo "head: ${CURR_COMMIT}";
echo "head:${CURR_COMMIT}";
echo "start:$(date +%s)";
echo "end:";
echo "last:";
......