Skip to content

Commit

Permalink
Per #1546, check return code of commands and exit non-zero if failure…
Browse files Browse the repository at this point in the history
…. This was not needed in Dockerfile because the commands were chained together with &&, but in a script execution will continue after a failed command
  • Loading branch information
georgemccabe committed Jan 20, 2022
1 parent 2a1579c commit 0ab6fd7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/docker/build_met_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,24 @@ echo "Configuring MET ${MET_GIT_NAME} and writing log file ${LOG_FILE}"
MET_FREETYPEINC=/usr/include/freetype2 MET_FREETYPELIB=/usr/lib \
MET_CAIROINC=/usr/include/cairo MET_CAIROLIB=/usr/lib \
MET_PYTHON_CC='-I/usr/include/python3.6m' MET_PYTHON_LD='-lpython3.6m' > ${LOG_FILE}
if [ $? != 0 ]; then
exit 1
fi

LOG_FILE=/met/MET-${MET_GIT_NAME}/make_install.log
echo "Compiling MET ${MET_GIT_NAME} and writing log file ${LOG_FILE}"
make install > ${LOG_FILE}
if [ $? != 0 ]; then
exit 1
fi

LOG_FILE=/met/logs/MET-${MET_GIT_NAME}_make_test.log
echo "Testing MET ${MET_GIT_NAME} and writing log file ${LOG_FILE}"
make test > ${LOG_FILE} 2>&1
if [ $? != 0 ]; then
exit 1
fi


if [[ $MET_GIT_NAME == "v"* ]]; then
cd /met; rm -rf MET-*;
Expand Down

0 comments on commit 0ab6fd7

Please sign in to comment.