Skip to content

Commit 617d299

Browse files
author
Terry McGUinness
committed
added the sourcing of gw_setup.sh for the script sections for creating experments and runnig them for the modules needed at runntime
1 parent 66105d0 commit 617d299

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

ci/Jenkinsfile

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,18 @@ pipeline {
180180
["${caseName}": {
181181
stage("Create ${caseName}") {
182182
script {
183-
env.RUNTESTS = "${CUSTOM_WORKSPACE}/RUNTESTS"
184-
try {
185-
error_output = sh(script: "${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh create_experiment ${HOMEgfs}/ci/cases/pr/${caseName}.yaml", returnStdout: true).trim()
186-
} catch (Exception error_create) {
187-
sh(script: """${GH} pr comment ${env.CHANGE_ID} --repo ${repo_url} --body "${Case} **FAILED** to create experiment on ${Machine} in BUILD# ${env.BUILD_NUMBER}\n with the error:\n\\`\\`\\`\n${error_output}\\`\\`\\`" """)
188-
error("Case ${caseName} failed to create experiment directory")
189-
}
190-
}
183+
env.RUNTESTS = "${CUSTOM_WORKSPACE}/RUNTESTS"
184+
try {
185+
// Source gw_setup.sh before creating experiments
186+
sh(script: """
187+
source ${CUSTOM_WORKSPACE}/workflow/gw_setup.sh
188+
${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh create_experiment ${HOMEgfs}/ci/cases/pr/${caseName}.yaml
189+
""")
190+
} catch (Exception error_create) {
191+
sh(script: """${GH} pr comment ${env.CHANGE_ID} --repo ${repo_url} --body "${caseName} **FAILED** to create experiment on ${Machine} in BUILD# ${env.BUILD_NUMBER}\n with the error:\n\\`\\`\\`\n${error_output}\\`\\`\\`" """)
192+
error("Case ${caseName} failed to create experiment directory")
193+
}
194+
}
191195
}
192196

193197
stage("Running ${caseName}") {
@@ -197,8 +201,12 @@ pipeline {
197201
def error_file = "${CUSTOM_WORKSPACE}/RUNTESTS/${pslot}_error.logs"
198202
sh(script: " rm -f ${error_file}")
199203
try {
200-
sh(script: "${HOMEgfs}/ci/scripts/run-check_ci.sh ${CUSTOM_WORKSPACE} ${pslot} 'global-workflow'")
201-
sh(script: "${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh cleanup_experiment ${CUSTOM_WORKSPACE}/RUNTESTS/EXPDIR/${pslot}")
204+
// Source gw_setup.sh before running the experiment
205+
sh(script: """
206+
source ${CUSTOM_WORKSPACE}/workflow/gw_setup.sh
207+
${HOMEgfs}/ci/scripts/run-check_ci.sh ${CUSTOM_WORKSPACE} ${pslot} 'global-workflow'
208+
${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh cleanup_experiment ${CUSTOM_WORKSPACE}/RUNTESTS/EXPDIR/${pslot}
209+
""")
202210
} catch (Exception error_experment) {
203211
sh(script: "${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh cancel_batch_jobs ${pslot}")
204212
ws(CUSTOM_WORKSPACE) {

0 commit comments

Comments
 (0)