Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
runOnCircle.sh 626 B
#!/bin/bash

check_var() {
  if [ -z "$1" ]
  then
    echo "Error: The $1 environment variable is undefined"
    exit 1
  fi
}

check_var CIRCLE_WORKING_DIRECTORY
check_var CIRCLE_BRANCH
check_var CIRCLE_JOB

CTEST_SCRIPT="${CIRCLE_WORKING_DIRECTORY}/scripts/dashboard/circle-el7_${CIRCLE_JOB}.cmake"

if [ ! -f "${CTEST_SCRIPT}" ]
then
  echo "Unable to find CTest script circle-el7_${CIRCLE_JOB}.cmake"
  exit 2
fi

case "$1" in
  configure|build|test)
    STEP=$1
    ;;
  *)
    echo "Usage: $0 (configure|build|test)"
    exit 3
    ;;
esac

ctest -VV -S ${CTEST_SCRIPT} -Ddashboard_full=OFF -Ddashboard_do_${STEP}=TRUE