Skip to content
Snippets Groups Projects
gen_ci_config 977 B
Newer Older
#!/bin/bash
set -o nounset
set -o errexit

CI_TAG=sodium

function print_the_help {
  echo "USAGE: $0 [-t <runner_tag>] "
  echo "  OPTIONS: "
  echo "            -t,--tag           Gitlab Runner tag"
  exit 
}

POSITIONAL=()
while [[ $# -gt 0 ]]
do
  key="$1"
  case $key in
    -h|--help)
      shift # past argument
      print_the_help
      ;;
    -t|--tag)
      CI_TAG="$2"
      shift # past argument
      shift # past value
      ;;
    *)    # unknown option
      #POSITIONAL+=("$1") # save it in an array for later
      echo "unknown option $1"
      print_the_help
      shift # past argument
      ;;
  esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters

cat <<EOF 
cal_test1:
  stage: detectors
  tags:
    - ${CI_TAG}
  script:
    - bash calorimeters/dummy_test.sh
  allow_failure: true

cal_test2:
  stage: detectors
  tags:
    - ${CI_TAG}
  script:
    - root -b -q calorimeters/zdc_neutrons_reader.cxx
  allow_failure: true
        
EOF