2021-05-25 18:00:49 +03:00
|
|
|
#!/usr/bin/env bash
|
2021-05-25 18:26:07 +03:00
|
|
|
LOG_FILE="earthly_log.txt"
|
|
|
|
touch $LOG_FILE
|
2021-05-25 18:00:49 +03:00
|
|
|
|
2021-06-09 20:31:04 +03:00
|
|
|
# first arg + everything after
|
|
|
|
ARGS=${@:1}
|
2021-06-09 20:40:27 +03:00
|
|
|
FULL_CMD="earthly --config ci/earthly-conf.yml $ARGS"
|
|
|
|
echo $FULL_CMD
|
|
|
|
script -efq $LOG_FILE -c "$FULL_CMD"
|
2021-05-25 19:55:06 +03:00
|
|
|
EXIT_CODE=$?
|
2021-05-25 18:00:49 +03:00
|
|
|
|
2021-05-25 18:26:07 +03:00
|
|
|
if grep -q "failed to mount" "$LOG_FILE"; then
|
2021-05-25 18:00:49 +03:00
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo "------<<<<<<!!!!!!>>>>>>------"
|
|
|
|
echo "DETECTED FAILURE TO MOUNT ERROR: running without cache"
|
|
|
|
echo "------<<<<<<!!!!!!>>>>>>------"
|
|
|
|
echo ""
|
|
|
|
echo ""
|
2021-06-02 15:36:53 +03:00
|
|
|
earthly --config ci/earthly-conf.yml --no-cache $ARGS
|
2021-05-25 18:00:49 +03:00
|
|
|
else
|
2021-05-25 19:55:06 +03:00
|
|
|
exit $EXIT_CODE
|
2021-05-25 18:00:49 +03:00
|
|
|
fi
|