From 5361d01ab1d6b30c7254059636264d3b46ee86c8 Mon Sep 17 00:00:00 2001
From: Whitney Armstrong <warmstrong@anl.gov>
Date: Mon, 20 Jul 2020 21:56:02 -0500
Subject: [PATCH] 	modified:   ../.gitignore 	modified:  
 ../.gitlab-ci.yml 	modified:   ../README.md 	new file:  
 gen_ci_config

---
 .gitignore                 |  1 +
 .gitlab-ci.yml             |  3 +++
 README.md                  |  9 +++++++
 calorimeters/gen_ci_config | 55 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 68 insertions(+)
 create mode 100755 calorimeters/gen_ci_config

diff --git a/.gitignore b/.gitignore
index aa8b5a9b..a743d854 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 results/*
 data/*
 datasets/*
+data
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 93f47ccc..40a2f9aa 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,6 +6,9 @@ default:
       - results/
       - datasets/
       - data
+        #    exclude:
+        #      - .git/
+        #      - datasets/.git/
 
 
 stages:
diff --git a/README.md b/README.md
index fc6c28fe..edf01dff 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,11 @@
 Benchmarks for NPDet
 ====================
+
+## Adding new benchmarks
+
+### Pass/Fail tests
+
+- Create a script that returns exit status 0 for success.
+- Any non-zero value will be considered failure.
+- Script  
+
diff --git a/calorimeters/gen_ci_config b/calorimeters/gen_ci_config
new file mode 100755
index 00000000..a6686320
--- /dev/null
+++ b/calorimeters/gen_ci_config
@@ -0,0 +1,55 @@
+#!/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
-- 
GitLab