anchor.diff:  #!/bin/bash
   
  -REPO_NAME=${REPO_NAME:-"alphagov/<%= app_name %>"}
  +GH_STATUS_REPO_NAME=${INITIATING_REPO_NAME:-"<%= app_name %>"}
   CONTEXT_MESSAGE=${CONTEXT_MESSAGE:-"default"}
  -GH_STATUS_GIT_COMMIT=${SCHEMA_GIT_COMMIT:-${GIT_COMMIT}}
  +GH_STATUS_GIT_COMMIT=${INITIATING_GIT_COMMIT:-${GIT_COMMIT}}
   
   function github_status {
  -  REPO_NAME="$1"
  -  STATUS="$2"
  -  MESSAGE="$3"
  -  gh-status "$REPO_NAME" "$GH_STATUS_GIT_COMMIT" "$STATUS" -d "Build #${BUILD_NUMBER} ${MESSAGE}" -u "$BUILD_URL" -c "$CONTEXT_MESSAGE" >/dev/null
  +  STATUS="$1"
  +  MESSAGE="$2"
  +  gh-status "$GH_STATUS_REPO_NAME" "$GH_STATUS_GIT_COMMIT" "$STATUS" -d "Build #${BUILD_NUMBER} ${MESSAGE}" -u "$BUILD_URL" -c "$CONTEXT_MESSAGE" >/dev/null
   }
   
   function error_handler {
  
positive.code: # bundle exec rake db:drop db:create db:schema:load
  
  if bundle exec rake ${TEST_TASK:-"default"}; then
    github_status "$REPO_NAME" success "succeeded on Jenkins"
  else
    github_status "$REPO_NAME" failure "failed on Jenkins"
    exit 1
  fi
  
negative.code:   else
      echo "Error on or near line ${parent_lineno}; exiting with status ${code}"
    fi
    github_status error "errored on Jenkins"
    exit "${code}"
  }
  
  trap 'error_handler ${LINENO}' ERR
  github_status pending "is running on Jenkins"
  
  # Cleanup anything left from previous test runs
  git clean -fdx
  