-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathJenkinsfileDeploy
38 lines (35 loc) · 1.94 KB
/
JenkinsfileDeploy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
def tag = env.TAG_NAME
def version = tag.substring(1) // Remove the first character of the tag which is 'v'
def machines = '[dom daint eiger pilatus tsa]' // To be included in the PR title
def reviewersPR = 'teojgo,ekouts' // The Github usernames requested for review
def ebTemplate = '23.12' // The eb recipe of ReFrame to use as template
def moduleName = 'reframe-cscs-tests'
def loginBash = '#!/bin/bash -l'
def ebRecipe = "${moduleName}-${version}.eb"
stage('Production PR') {
node('daint') {
// Retrieve the latest version of ReFrame
def reframeVersion = sh(returnStdout: true,
script: """${loginBash}
module load reframe
reframe -V""").trim()
println("Found ReFrame version: ${reframeVersion}")
dir('production_repo') {
sh(returnStatus: true,
script: """#!/bin/bash -l
module load daint-gpu
module load hub
git clone [email protected]:eth-cscs/production.git
cd production/easybuild/easyconfigs/r/${moduleName}
git checkout -b ${moduleName}/${version}
sed -r "s/(version\\s*=\\s*)'${ebTemplate}'/\\1'${version}'/g" ${moduleName}-${ebTemplate}.eb > ${ebRecipe}
sed -ri "s/(dependencies\\s*=\\s*\\[\\('reframe'\\s*,\\s*)\\S*\\)\\]/\\1'${reframeVersion}'\\)\\]/g" ${ebRecipe}
git add ${ebRecipe}
git commit -m "Add recipe for ReFrame CSCS tests version ${version}"
git push origin HEAD
hub pull-request -r ${reviewersPR} -m "${machines} Add recipe for ReFrame CSCS tests version ${version}"
""")
deleteDir()
}
}
}