From 167e305518fbb6edfaad6f9036ed6eca833bd1bc Mon Sep 17 00:00:00 2001
From: Simon Spannagel <simon.spannagel@cern.ch>
Date: Mon, 11 Jul 2022 18:51:53 +0200
Subject: [PATCH] Update CI scripts

---
 .gitlab/ci/codespell_ignored_words.txt | 3 +++
 .gitlab/ci/download_artifacts.py       | 9 ++++++---
 .gitlab/ci/gitlab_deploy.sh            | 3 +++
 .gitlab/ci/load_deps.sh                | 4 ++++
 .gitlab/ci/transform_ctest_junit.py    | 5 ++++-
 5 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/.gitlab/ci/codespell_ignored_words.txt b/.gitlab/ci/codespell_ignored_words.txt
index 704f4bb49..038723931 100644
--- a/.gitlab/ci/codespell_ignored_words.txt
+++ b/.gitlab/ci/codespell_ignored_words.txt
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2022 CERN and the Corryvreckan authors
+# SPDX-License-Identifier: CC0-1.0
+
 # Words to be ignored by codespell.
 # Put one word per line and sort alphabetically.
 claus
diff --git a/.gitlab/ci/download_artifacts.py b/.gitlab/ci/download_artifacts.py
index 3a629f2ed..cd9e2d1fc 100755
--- a/.gitlab/ci/download_artifacts.py
+++ b/.gitlab/ci/download_artifacts.py
@@ -1,4 +1,7 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+
+# SPDX-FileCopyrightText: 2022 CERN and the Corryvreckan authors
+# SPDX-License-Identifier: MIT
 
 import os
 import json
@@ -12,7 +15,7 @@ api_token = sys.argv[1]
 ci_project_id = sys.argv[2]
 ci_pipeline_id = sys.argv[3]
 
-print "Downloading job list"
+print("Downloading job list")
 data = json.load(os.popen("curl -g --header \"PRIVATE-TOKEN:%s\" \"https://gitlab.cern.ch/api/v4/projects/%s/pipelines/%s/jobs?scope[]=success&per_page=100\"" % (api_token, ci_project_id, ci_pipeline_id)))
 
 # Find last passed builds
@@ -20,6 +23,6 @@ for i in range(0, len(data)):
   if "pkg:" not in data[i]['name']:
     continue
 
-  print "Downloading artifact for job %s" % data[i]['id']
+  print("Downloading artifact for job %s" % data[i]['id'])
   os.system("curl --location --header \"PRIVATE-TOKEN:%s\" \"https://gitlab.cern.ch/api/v4/projects/%s/jobs/%s/artifacts\" -o artifact.zip" % (api_token, ci_project_id, data[i]['id']))
   os.system("unzip -j artifact.zip; rm artifact.zip")
diff --git a/.gitlab/ci/gitlab_deploy.sh b/.gitlab/ci/gitlab_deploy.sh
index 5c6f30562..ecea63d8c 100755
--- a/.gitlab/ci/gitlab_deploy.sh
+++ b/.gitlab/ci/gitlab_deploy.sh
@@ -1,5 +1,8 @@
 #!/bin/bash
 
+# SPDX-FileCopyrightText: 2022 CERN and the Corryvreckan authors
+# SPDX-License-Identifier: MIT
+
 #Get the line for the CVMFS status and check if server is transaction
 clicdp_status=`cvmfs_server list | grep clicdp`
 if [[ $clicdp_status == *"(stratum0 / S3)"* ]]; then
diff --git a/.gitlab/ci/load_deps.sh b/.gitlab/ci/load_deps.sh
index e42031d7d..34fa213f2 100644
--- a/.gitlab/ci/load_deps.sh
+++ b/.gitlab/ci/load_deps.sh
@@ -1 +1,5 @@
+# SPDX-FileCopyrightText: 2017-2022 CERN and the Allpix Squared authors
+# SPDX-License-Identifier: MIT
+
 source $ROOTSYS/bin/thisroot.sh
+source $G4INSTALL/bin/geant4.sh
diff --git a/.gitlab/ci/transform_ctest_junit.py b/.gitlab/ci/transform_ctest_junit.py
index 5249bcf5b..f4fd33d01 100755
--- a/.gitlab/ci/transform_ctest_junit.py
+++ b/.gitlab/ci/transform_ctest_junit.py
@@ -1,4 +1,7 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+
+# SPDX-FileCopyrightText: 2022 CERN and the Corryvreckan authors
+# SPDX-License-Identifier: MIT
 
 import sys
 import lxml.etree as et
-- 
GitLab