Skip to content

Commit

Permalink
[CI] add option to use custom spack-c2sm branch for spack tests (#268)
Browse files Browse the repository at this point in the history
* add option to use custom spack-c2sm branch for spack tests

* fix missing declarations

* fix missing declarations

---------

Co-authored-by: Jonas Jucker <[email protected]>
  • Loading branch information
2 people authored and Nina Burgdorfer committed Sep 27, 2023
1 parent a95c820 commit 0872455
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 7 deletions.
17 changes: 16 additions & 1 deletion jenkins/spack-PR
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
def repo_identifier = "Project"
def spack_fork = "C2SM"
def spack_branch = "main"
String[] triggerPhrase = env.ghprbCommentBody.split(" ")

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 {
Expand All @@ -20,7 +35,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
"""
}
Expand Down
5 changes: 0 additions & 5 deletions jenkins/spack-PR-icon
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
}
}

Expand Down
17 changes: 16 additions & 1 deletion jenkins/spack-PR-stable
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
def repo_identifier = "Project"
def spack_fork = "C2SM"
def spack_branch = "main"
String[] triggerPhrase = env.ghprbCommentBody.split(" ")

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 {
Expand All @@ -20,7 +35,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
"""
}
Expand Down

0 comments on commit 0872455

Please sign in to comment.