Commit 2347b15f authored by Ari Trachtenberg's avatar Ari Trachtenberg
Browse files

changed timeout to trap in the gitlab job

parent 956b270d
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -56,7 +56,19 @@ extra_credit:
    - cp IntegerP.cpp IntegerPP.cpp hw1_ec
    - cd hw1_ec
    - make extra
    - score="$(./extra | tail -n 1 | tr -d '[:space:]')"
    - set -o pipefail
    - |
      set +e
      timeout 60s stdbuf -oL ./extra | tee extra.out
      STATUS=${PIPESTATUS[0]}
      set -e

      if [ "$STATUS" -eq 255 ]; then
        echo "computed result incorrect - job failed"
        exit 1
      fi

      score="$(tail -n 1 extra.out | tr -d '[:space:]')"
    - echo "Your score is $score"
    - curl "https://agile.bu.edu/ec330_scripts/saveScores.pl?key=${MAGIC_KEY}&file=hw1extra&name=${GITLAB_USER_LOGIN}&score=${score}"
  rules: