Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 23 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ pipeline {
stages {
stage('SetEnvVar'){
steps{
sh '''
set +x
'''
script{
String s = env.JOB_NAME
s = s.substring(s.indexOf("/") + 1)
Expand Down Expand Up @@ -102,6 +105,7 @@ pipeline {
steps{
echo 'Clean the working environment.'
sh '''
set +x
if [ -d "/data/jenkins/workspace/${DATA_DIR}/PR$CHANGE_ID" ]
then
rm -rf /data/jenkins/workspace/${DATA_DIR}/PR$CHANGE_ID
Expand All @@ -113,6 +117,7 @@ pipeline {
steps {
echo 'Install automatic validation package HGCTPGValidation.'
sh '''
set +x
uname -a
whoami
pwd
Expand All @@ -136,18 +141,21 @@ pipeline {
}
stage('SetCMSSWEnvVar'){
steps{
sh '''
set +x
'''
script{
if ( env.JOB_FLAG == 0 ){
env.REF_RELEASE = sh(returnStdout: true, script: 'source ./HGCTPGValidation/scripts/extractReleaseName.sh ${CHANGE_TARGET}').trim()
env.SCRAM_ARCH = sh(returnStdout: true, script: 'source ./HGCTPGValidation/scripts/getScramArch.sh ${REF_RELEASE}').trim()
env.REF_RELEASE = sh(returnStdout: true, script: 'set +x exec &>> log_Jenkins; source ./HGCTPGValidation/scripts/extractReleaseName.sh ${CHANGE_TARGET}; exit').trim()
env.SCRAM_ARCH = sh(returnStdout: true, script: 'set +x exec &>> log_Jenkins; source ./HGCTPGValidation/scripts/getScramArch.sh ${REF_RELEASE}; exit').trim();
println(env.REF_RELEASE)
println(env.SCRAM_ARCH)
}
else {
env.REF_BRANCH = sh(returnStdout: true, script: 'module use /opt/exp_soft/vo.llr.in2p3.fr/modulefiles_el7/; module purge; module load python/3.9.9; python ./HGCTPGValidation/scripts/get_cmsswRefBranch.py').trim()
env.REF_RELEASE = sh(returnStdout: true, script: 'source ./HGCTPGValidation/scripts/extractReleaseName.sh ${REF_BRANCH}').trim()
env.SCRAM_ARCH = sh(returnStdout: true, script: 'source ./HGCTPGValidation/scripts/getScramArch.sh ${REF_RELEASE}').trim()
env.BASE_REMOTE = sh(returnStdout: true, script: 'module use /opt/exp_soft/vo.llr.in2p3.fr/modulefiles_el7/; module purge; module load python/3.9.9; python ./HGCTPGValidation/scripts/get_remoteParam.py').trim()
env.REF_BRANCH = sh(returnStdout: true, script: 'set +x exec &>> log_Jenkins; module use /opt/exp_soft/vo.llr.in2p3.fr/modulefiles_el7/; module purge; module load python/3.9.9; python ./HGCTPGValidation/scripts/get_cmsswRefBranch.py; exit').trim()
env.REF_RELEASE = sh(returnStdout: true, script: 'set +x exec &>> log_Jenkins; source ./HGCTPGValidation/scripts/extractReleaseName.sh ${REF_BRANCH}; exit').trim()
env.SCRAM_ARCH = sh(returnStdout: true, script: 'set +x exec &>> log_Jenkins; source ./HGCTPGValidation/scripts/getScramArch.sh ${REF_RELEASE}; exit').trim()
env.BASE_REMOTE = sh(returnStdout: true, script: 'set +x exec &>> log_Jenkins; module use /opt/exp_soft/vo.llr.in2p3.fr/modulefiles_el7/; module purge; module load python/3.9.9; python ./HGCTPGValidation/scripts/get_remoteParam.py; exit').trim()
env.CHANGE_BRANCH = env.REF_BRANCH
env.CHANGE_TARGET = env.REF_BRANCH
env.REMOTE = env.BASE_REMOTE
Expand All @@ -169,6 +177,7 @@ pipeline {
steps {
echo 'InstallCMSSW Test step..'
sh '''
set +x
pwd
cd test_dir
if [ -z "$CHANGE_FORK" ]
Expand All @@ -185,6 +194,7 @@ pipeline {
stage('QualityChecks'){
steps{
sh '''
set +x
source /cvmfs/cms.cern.ch/cmsset_default.sh
cd test_dir/${REF_RELEASE}_HGCalTPGValidation_${LABEL_TEST}/src
scram build code-checks
Expand All @@ -200,6 +210,7 @@ pipeline {
stage('Produce'){
steps {
sh '''
set +x
pwd
cd test_dir/${REF_RELEASE}_HGCalTPGValidation_${LABEL_TEST}/src
module use /opt/exp_soft/vo.llr.in2p3.fr/modulefiles_el7/
Expand All @@ -221,6 +232,7 @@ pipeline {
steps {
echo 'InstallCMSSW Ref step..'
sh '''
set +x
pwd
cd test_dir
../HGCTPGValidation/scripts/installCMSSW.sh $SCRAM_ARCH $REF_RELEASE $BASE_REMOTE $BASE_REMOTE $CHANGE_TARGET $CHANGE_TARGET ${LABEL_REF}
Expand All @@ -230,6 +242,7 @@ pipeline {
stage('Produce'){
steps {
sh '''
set +x
pwd
cd test_dir/${REF_RELEASE}_HGCalTPGValidation_${LABEL_REF}/src
module use /opt/exp_soft/vo.llr.in2p3.fr/modulefiles_el7/
Expand All @@ -246,6 +259,7 @@ pipeline {
stage('Display') {
steps {
sh '''
set +x
cd test_dir
source ../HGCTPGValidation/env_install.sh
echo $PWD
Expand All @@ -255,6 +269,9 @@ pipeline {
}
}
post {
always {
archiveArtifacts artifacts: 'log_Jenkins', fingerprint: true
}
success {
echo 'The job finished successfully.'
mail to: "${EMAIL_TO}",
Expand Down