From 89c2ee2f9362fb8f696bab400a1f30c823b4b709 Mon Sep 17 00:00:00 2001 From: Jonas Jucker Date: Tue, 12 Sep 2023 12:43:48 +0200 Subject: [PATCH 1/3] add option to use custom spack-c2sm branch for spack tests --- jenkins/spack-PR | 15 ++++++++++++++- jenkins/spack-PR-icon | 5 ----- jenkins/spack-PR-stable | 15 ++++++++++++++- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/jenkins/spack-PR b/jenkins/spack-PR index 322dd30209..883201c1e5 100644 --- a/jenkins/spack-PR +++ b/jenkins/spack-PR @@ -1,3 +1,16 @@ +def spack_fork = "C2SM" +def spack_branch = "main" + +def parseTriggerPhrase(it) { + fork = it.split("=")[1].split("/")[0] + branch = it.split("=")[1].split("/")[1] + return [fork, branch] +} +triggerPhrase.each { + if(it.contains("spack${repo_identifier}")) { + (spack_fork, spack_branch) = parseTriggerPhrase(it) + } +} pipeline { agent none stages { @@ -20,7 +33,7 @@ pipeline { stage('Clone Repos') { steps { sh """ - git clone --depth 1 --recurse-submodules --shallow-submodules https://github.com/C2SM/spack-c2sm.git + git clone --depth 1 --recurse-submodules --shallow-submodules -b '${spack_branch}' https://github.com/${spack_fork}/spack-c2sm.git git clone . local_copy """ } diff --git a/jenkins/spack-PR-icon b/jenkins/spack-PR-icon index 7cadc494df..4d0fe56c22 100644 --- a/jenkins/spack-PR-icon +++ b/jenkins/spack-PR-icon @@ -1,11 +1,9 @@ def repo_identifier = "Project" def icon_fork = "C2SM" def icon_branch = "icon-dsl" -def icon_default = true def spack_fork = "C2SM" def spack_branch = "main" -def spack_default = true def gt4py_fork = "GridTools" def gt4py_branch = "icon4py_20230621" @@ -20,19 +18,16 @@ def parseTriggerPhrase(it) { triggerPhrase.each { if(it.contains("icon${repo_identifier}")) { (icon_fork, icon_branch) = parseTriggerPhrase(it) - icon_default = false } } triggerPhrase.each { if(it.contains("spack${repo_identifier}")) { (spack_fork, spack_branch) = parseTriggerPhrase(it) - spack_default = false } } triggerPhrase.each { if(it.contains("gt4py${repo_identifier}")) { (gt4py_fork, gt4py_branch) = parseTriggerPhrase(it) - gt4py_default = false } } diff --git a/jenkins/spack-PR-stable b/jenkins/spack-PR-stable index 78b85b9961..b736d05771 100644 --- a/jenkins/spack-PR-stable +++ b/jenkins/spack-PR-stable @@ -1,3 +1,16 @@ +def spack_fork = "C2SM" +def spack_branch = "main" + +def parseTriggerPhrase(it) { + fork = it.split("=")[1].split("/")[0] + branch = it.split("=")[1].split("/")[1] + return [fork, branch] +} +triggerPhrase.each { + if(it.contains("spack${repo_identifier}")) { + (spack_fork, spack_branch) = parseTriggerPhrase(it) + } +} pipeline { agent none stages { @@ -20,7 +33,7 @@ pipeline { stage('Clone Repos') { steps { sh """ - git clone --depth 1 --recurse-submodules --shallow-submodules https://github.com/C2SM/spack-c2sm.git + git clone --depth 1 --recurse-submodules --shallow-submodules -b '${spack_branch}' https://github.com/${spack_fork}/spack-c2sm.git git clone . local_copy """ } From 2b64be192fcebd6a930e314564d3d79b0e1448dd Mon Sep 17 00:00:00 2001 From: Jonas Jucker Date: Tue, 12 Sep 2023 14:57:53 +0200 Subject: [PATCH 2/3] fix missing declarations --- jenkins/spack-PR | 1 + jenkins/spack-PR-stable | 1 + 2 files changed, 2 insertions(+) diff --git a/jenkins/spack-PR b/jenkins/spack-PR index 883201c1e5..a183295655 100644 --- a/jenkins/spack-PR +++ b/jenkins/spack-PR @@ -1,5 +1,6 @@ def spack_fork = "C2SM" def spack_branch = "main" +String[] triggerPhrase = env.ghprbCommentBody.split(" ") def parseTriggerPhrase(it) { fork = it.split("=")[1].split("/")[0] diff --git a/jenkins/spack-PR-stable b/jenkins/spack-PR-stable index b736d05771..858cd188cd 100644 --- a/jenkins/spack-PR-stable +++ b/jenkins/spack-PR-stable @@ -1,5 +1,6 @@ def spack_fork = "C2SM" def spack_branch = "main" +String[] triggerPhrase = env.ghprbCommentBody.split(" ") def parseTriggerPhrase(it) { fork = it.split("=")[1].split("/")[0] From 5072c459b863527907ba194bf6cb6b97d3825bb8 Mon Sep 17 00:00:00 2001 From: Jonas Jucker Date: Tue, 12 Sep 2023 15:00:04 +0200 Subject: [PATCH 3/3] fix missing declarations --- jenkins/spack-PR | 1 + jenkins/spack-PR-stable | 1 + 2 files changed, 2 insertions(+) diff --git a/jenkins/spack-PR b/jenkins/spack-PR index a183295655..e9be0ac87c 100644 --- a/jenkins/spack-PR +++ b/jenkins/spack-PR @@ -1,3 +1,4 @@ +def repo_identifier = "Project" def spack_fork = "C2SM" def spack_branch = "main" String[] triggerPhrase = env.ghprbCommentBody.split(" ") diff --git a/jenkins/spack-PR-stable b/jenkins/spack-PR-stable index 858cd188cd..b2a317a4ff 100644 --- a/jenkins/spack-PR-stable +++ b/jenkins/spack-PR-stable @@ -1,3 +1,4 @@ +def repo_identifier = "Project" def spack_fork = "C2SM" def spack_branch = "main" String[] triggerPhrase = env.ghprbCommentBody.split(" ")