Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/ci metrics #4

Draft
wants to merge 109 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
9916f44
template files for cicd pipeline builds
BruceKropp-Raytheon Nov 8, 2024
a8c0c62
start with a Jenkinsfile that doesnt push logs to the repo
BruceKropp-Raytheon Nov 8, 2024
728598b
Merge branch 'develop' into feature/ci_metrics
BruceKropp-Raytheon Nov 12, 2024
8839312
Update Jenkinsfile.pipeline
BruceKropp-Raytheon Nov 13, 2024
d2ca0c8
template test scripts
BruceKropp-Raytheon Nov 13, 2024
16956fd
Merge branch 'feature/ci_metrics' of github.com:NOAA-EPIC/ufs-weather…
BruceKropp-Raytheon Nov 13, 2024
e6d3472
lint issues
BruceKropp-Raytheon Nov 13, 2024
042f1dc
regression test scripts
BruceKropp-Raytheon Nov 13, 2024
9c13414
optional suite
BruceKropp-Raytheon Nov 14, 2024
d286efa
wrap suite name and compiler in quotes for -n opt
BruceKropp-Raytheon Nov 15, 2024
be0337c
create a tests/log/ dir
BruceKropp-Raytheon Nov 15, 2024
10ceba8
define WORKSPACE within machine
BruceKropp-Raytheon Nov 15, 2024
b5f956a
define WORKSPACE as PWD
BruceKropp-Raytheon Nov 15, 2024
588ffeb
temp save out the test log
BruceKropp-Raytheon Nov 16, 2024
d3982fe
align scripts
BruceKropp-Raytheon Nov 18, 2024
1e1c3cf
add wm_test script
BruceKropp-Raytheon Nov 18, 2024
0cc14dd
check git for orion
BruceKropp-Raytheon Nov 18, 2024
84805cd
regression test skips PW cluster hosts, for now
BruceKropp-Raytheon Nov 18, 2024
7380a89
fix array parsing on disk_usage.sh
BruceKropp-Raytheon Nov 18, 2024
5a7d187
migrate build stage to wm_build.sh
BruceKropp-Raytheon Nov 19, 2024
beed122
enable create_baseline flow
BruceKropp-Raytheon Nov 19, 2024
a08312c
mkdir -p BLdate-dir
BruceKropp-Raytheon Nov 19, 2024
7f1bd33
try to clear up rsync error for setting times
BruceKropp-Raytheon Nov 19, 2024
6961e2d
capture and ignore rsync errors
BruceKropp-Raytheon Nov 19, 2024
f81b23f
Catch errors on chgrp
BruceKropp-Raytheon Nov 20, 2024
6c8870c
warn on missing REGRESSION_TEST/ for baseline rsync
BruceKropp-Raytheon Nov 20, 2024
b338bc1
handle return condition on test scripts
BruceKropp-Raytheon Nov 20, 2024
4d2bca2
report error for missing REGRESSION_TEST/
BruceKropp-Raytheon Nov 20, 2024
1ad2783
define and use machine_id as lower case machine, use workflow variable
BruceKropp-Raytheon Nov 20, 2024
9cf9307
wm_test.sh ready
BruceKropp-Raytheon Nov 20, 2024
e9153a0
handle empty CHANGE_ID
BruceKropp-Raytheon Nov 21, 2024
62863e9
handle empty CHANGE_ID
BruceKropp-Raytheon Nov 21, 2024
cabf94b
jet changed from /lfs1 to /lfs5
BruceKropp-Raytheon Nov 26, 2024
5874b4f
Create Jenkinsfile.metrics
BruceKropp-Raytheon Dec 2, 2024
2318541
Update Jenkinsfile.metrics
BruceKropp-Raytheon Dec 2, 2024
ed5bb23
Update Jenkinsfile.metrics
BruceKropp-Raytheon Dec 2, 2024
5ea45a9
fix lint warnings
BruceKropp-Raytheon Dec 2, 2024
963ab22
superlint fixes
BruceKropp-Raytheon Dec 2, 2024
76564b7
fix superlint on array initializatoin
BruceKropp-Raytheon Dec 2, 2024
db485ba
fix lint for vars
BruceKropp-Raytheon Dec 3, 2024
7f9f960
ease up on .shellcheckrc lint limits
BruceKropp-Raytheon Dec 3, 2024
61a4e89
lint complains about egrep
BruceKropp-Raytheon Dec 3, 2024
9914c09
superlinter checks on our own bash scripts
BruceKropp-Raytheon Dec 3, 2024
23edf74
referring to specific platform files are to be tollerated
BruceKropp-Raytheon Dec 3, 2024
2747278
relax some shellcheck items
BruceKropp-Raytheon Dec 3, 2024
203080f
allow assign with local VAR=val
BruceKropp-Raytheon Dec 3, 2024
b4dab06
clean out some unused vars
BruceKropp-Raytheon Dec 4, 2024
b7e629e
set a real Jenkinsfile
BruceKropp-Raytheon Dec 4, 2024
6cfb3f6
fix unassigned CHANGE_ID and GIT_URL
BruceKropp-Raytheon Dec 4, 2024
494ce47
fix tar log path
BruceKropp-Raytheon Dec 4, 2024
6481422
move posting results to a separate script
BruceKropp-Raytheon Dec 4, 2024
21a0f29
move post to a separate stage
BruceKropp-Raytheon Dec 4, 2024
c986e97
allow PW cluster machines
BruceKropp-Raytheon Dec 5, 2024
b4ee308
add Post Regression Test as a stage
BruceKropp-Raytheon Dec 5, 2024
0b9e9e6
add flag whether to post results here or let it happen in a separate …
BruceKropp-Raytheon Dec 5, 2024
5f9a2ae
fix unbound vars
BruceKropp-Raytheon Dec 6, 2024
c75fc53
fix another unbound var
BruceKropp-Raytheon Dec 6, 2024
ac925ed
exclude RT from PW cluster machines
BruceKropp-Raytheon Dec 6, 2024
6f1a412
clear Jenkinsfile when conditions
BruceKropp-Raytheon Dec 6, 2024
5422ed8
full path to GNU bash for login exec
BruceKropp-Raytheon Dec 6, 2024
09404c7
add space before bash for login exec
BruceKropp-Raytheon Dec 6, 2024
528d146
fix typo in wm_test.sh
BruceKropp-Raytheon Dec 6, 2024
264bed2
add a template build stage
BruceKropp-Raytheon Dec 6, 2024
64a282d
Build stage to run wm_build.sh
BruceKropp-Raytheon Dec 6, 2024
77486be
fix param choices
BruceKropp-Raytheon Dec 7, 2024
11ffcca
default vars
BruceKropp-Raytheon Dec 7, 2024
93a4273
machine_id tolower
BruceKropp-Raytheon Dec 7, 2024
a04386c
disable build since NetCDF is not found
BruceKropp-Raytheon Dec 7, 2024
7c2bf03
NODE_NAME, machine, UFS_PLATFORM, machine_id, ...
BruceKropp-Raytheon Dec 7, 2024
f7f5531
show node name
BruceKropp-Raytheon Dec 7, 2024
cce3978
add boolean whether to run build stage before regression test
BruceKropp-Raytheon Dec 9, 2024
c057426
add step when to run build stage before regression test
BruceKropp-Raytheon Dec 9, 2024
bf7f6a7
add step when to run build inside node before regression test
BruceKropp-Raytheon Dec 9, 2024
61b888f
add conditional if to build stage
BruceKropp-Raytheon Dec 9, 2024
e6b399b
add description to build stage
BruceKropp-Raytheon Dec 9, 2024
3b52ffd
add call to wm_init.sh to help metrics job
BruceKropp-Raytheon Dec 9, 2024
562afcd
limit parsing STAGE_NAME to just the first arg
BruceKropp-Raytheon Dec 9, 2024
8886a8a
Merge remote-tracking branch 'origin/develop' into feature/ci_metrics
BruceKropp-Raytheon Dec 9, 2024
46907d7
set env default for UFS_COMPILER
BruceKropp-Raytheon Dec 9, 2024
5670e7d
UFS_PLATFORM should be all lower case
BruceKropp-Raytheon Dec 9, 2024
b9f7917
save metrics and results files to s3
BruceKropp-Raytheon Dec 10, 2024
aed73bd
set env.UFS_PLATFORM
BruceKropp-Raytheon Dec 10, 2024
19e172b
set env.UFS_PLATFORM in each node stage
BruceKropp-Raytheon Dec 10, 2024
da5c8f9
use env.UFS_PLATFORM in init stage
BruceKropp-Raytheon Dec 10, 2024
fb40659
use env.UFS_PLATFORM in node
BruceKropp-Raytheon Dec 10, 2024
4f49dda
use nodeLabel in node
BruceKropp-Raytheon Dec 10, 2024
503944b
try UFS_PLATFORM
BruceKropp-Raytheon Dec 10, 2024
8175086
try env.NODE_NAME
BruceKropp-Raytheon Dec 10, 2024
8ad81c3
try env.UFS_PLATFORM
BruceKropp-Raytheon Dec 10, 2024
8c8953d
try NODE_NAME
BruceKropp-Raytheon Dec 10, 2024
6305c6a
try to lower NODE_NAME
BruceKropp-Raytheon Dec 10, 2024
4524bc7
try to lower nodeLabel
BruceKropp-Raytheon Dec 10, 2024
20f10e3
try to lower nodeLabel, replaced
BruceKropp-Raytheon Dec 10, 2024
b082520
try to lower nodeLabel, fix typo
BruceKropp-Raytheon Dec 10, 2024
fa667b6
create an init stage time file
BruceKropp-Raytheon Dec 10, 2024
5c6903b
disk_usage outfile
BruceKropp-Raytheon Dec 10, 2024
da6e094
define a platform var in init stage
BruceKropp-Raytheon Dec 10, 2024
7f75cce
remove single quotes from UFS_PLATFORM
BruceKropp-Raytheon Dec 10, 2024
1fff46b
remove single quotes from UFS_PLATFORM typo
BruceKropp-Raytheon Dec 10, 2024
7d3ce30
WM_OPERATIONAL_TESTS typo
BruceKropp-Raytheon Dec 10, 2024
0a0214b
use def UFS_PLATFORM
BruceKropp-Raytheon Dec 10, 2024
833c2ce
save test_results and zip of logs
BruceKropp-Raytheon Dec 10, 2024
ce090f4
save zips
epic-cicd-jenkins Dec 10, 2024
3b45b80
use environment vars in post script
epic-cicd-jenkins Dec 11, 2024
8abcea5
post zip and add call to ufs-wm-metrics job
epic-cicd-jenkins Dec 11, 2024
9fa5ba6
create a logs tar
epic-cicd-jenkins Dec 11, 2024
a7426e0
debug GIT vars
epic-cicd-jenkins Dec 11, 2024
fe9a128
move log tar-ing to Jenkinsfile
epic-cicd-jenkins Dec 11, 2024
00e800b
print debugging for posting results to repo
epic-cicd-jenkins Dec 11, 2024
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
210 changes: 210 additions & 0 deletions .cicd/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
matchedNode = []
generateBaselineNode = []
for (label in pullRequest.labels) {
listOfLabelNodeNames = jenkins.model.Jenkins.instance.nodes.collect {
node -> node.getLabelString().contains(label) ? node.name : null

if ((label.matches(node.getLabelString()+"-(.*)"))) {
matchedNode += node.getLabelString()
}

if ((label.matches(node.getLabelString()+"(.*)-BL"))) {
generateBaselineNode += node.getLabelString()
}
}
}

modifiedLabels = matchedNode.collect{"'" + it + "'"}
baselineLabels = generateBaselineNode.collect{"'" + it + "'"}
def generateStage(nodeLabel) {
return {
stage("Initialize on ${nodeLabel.replaceAll("'","")}") {
node(nodeLabel) {
script {
currentBuild.displayName = "#${BUILD_NUMBER} ${nodeLabel.replaceAll("'","")} test=${params.WM_OPERATIONAL_TESTS}"
}
cleanWs()
checkout scm
script {
def UFS_PLATFORM = nodeLabel.replaceAll("'","")
echo "nodeLabel=${nodeLabel} NODE_NAME=${NODE_NAME} UFS_PLATFORM=${UFS_PLATFORM} UFS_COMPILER=${env.UFS_COMPILER}"
sh 'bash --login "${WORKSPACE}/.cicd/scripts/wm_init.sh"'
sh "STAGE_NAME='${env.STAGE_NAME}' " + 'bash --login "${WORKSPACE}/.cicd/scripts/disk_usage.sh"'
s3Upload consoleLogLevel: 'INFO', dontSetBuildResultOnFailure: false, dontWaitForConcurrentBuildCompletion: false, entries: [[bucket: 'noaa-epic-prod-jenkins-artifacts', excludedFile: '', flatten: false, gzipFiles: false, keepForever: false, managedArtifacts: true, noUploadOnFailure: false, selectedRegion: 'us-east-1', showDirectlyInBrowser: false, sourceFile: "${UFS_PLATFORM}-*-time-wm_init.json", storageClass: 'STANDARD', uploadFromSlave: false, useServerSideEncryption: false]], pluginFailureResultConstraint: 'FAILURE', profileName: 'main', userMetadata: []
s3Upload consoleLogLevel: 'INFO', dontSetBuildResultOnFailure: false, dontWaitForConcurrentBuildCompletion: false, entries: [[bucket: 'noaa-epic-prod-jenkins-artifacts', excludedFile: '', flatten: false, gzipFiles: false, keepForever: false, managedArtifacts: true, noUploadOnFailure: false, selectedRegion: 'us-east-1', showDirectlyInBrowser: false, sourceFile: "${UFS_PLATFORM}-*-disk-usageInit*.csv", storageClass: 'STANDARD', uploadFromSlave: false, useServerSideEncryption: false]], pluginFailureResultConstraint: 'FAILURE', profileName: 'main', userMetadata: []
}
}
}
stage("Build on ${nodeLabel.replaceAll("'","")}") {
if (params.WM_BUILD == true ) {
node(nodeLabel) {
script {
def UFS_PLATFORM = nodeLabel.replaceAll("'","")
//currentBuild.displayName = "#${BUILD_NUMBER} ${nodeLabel.replaceAll("'","")} ${UFS_COMPILER}"
currentBuild.description = "build ${UFS_PLATFORM}-${UFS_COMPILER}"

echo "Building on ${nodeLabel}"
sh 'bash --login "${WORKSPACE}/.cicd/scripts/wm_build.sh"'
sh "STAGE_NAME='${env.STAGE_NAME}' " + 'bash --login "${WORKSPACE}/.cicd/scripts/disk_usage.sh"'
s3Upload consoleLogLevel: 'INFO', dontSetBuildResultOnFailure: false, dontWaitForConcurrentBuildCompletion: false, entries: [[bucket: 'noaa-epic-prod-jenkins-artifacts', excludedFile: '', flatten: false, gzipFiles: false, keepForever: false, managedArtifacts: true, noUploadOnFailure: false, selectedRegion: 'us-east-1', showDirectlyInBrowser: false, sourceFile: "${UFS_PLATFORM}-*-time-wm_build.json", storageClass: 'STANDARD', uploadFromSlave: false, useServerSideEncryption: false]], pluginFailureResultConstraint: 'FAILURE', profileName: 'main', userMetadata: []
s3Upload consoleLogLevel: 'INFO', dontSetBuildResultOnFailure: false, dontWaitForConcurrentBuildCompletion: false, entries: [[bucket: 'noaa-epic-prod-jenkins-artifacts', excludedFile: '', flatten: false, gzipFiles: false, keepForever: false, managedArtifacts: true, noUploadOnFailure: false, selectedRegion: 'us-east-1', showDirectlyInBrowser: false, sourceFile: "${UFS_PLATFORM}-*-disk-usageBuild.csv", storageClass: 'STANDARD', uploadFromSlave: false, useServerSideEncryption: false]], pluginFailureResultConstraint: 'FAILURE', profileName: 'main', userMetadata: []
}
}
} else {
echo "Building on ${nodeLabel} skipped"
}
}
stage("Test on ${nodeLabel.replaceAll("'","")}") {
if (params.WM_OPERATIONAL_TESTS != 'none' ) {
node(nodeLabel) {
script {
def UFS_PLATFORM = nodeLabel.replaceAll("'","")
try {
echo "Running Tests on ${nodeLabel}"
if (baselineLabels.contains(nodeLabel)) {
sh "WM_CREATE_BASELINE=true " + 'bash --login "${WORKSPACE}/.cicd/scripts/wm_test.sh"'
}
else {
sh "WM_CREATE_BASELINE=false " + 'bash --login "${WORKSPACE}/.cicd/scripts/wm_test.sh"'
}
s3Upload consoleLogLevel: 'INFO', dontSetBuildResultOnFailure: false, dontWaitForConcurrentBuildCompletion: false, entries: [[bucket: 'noaa-epic-prod-jenkins-artifacts', excludedFile: '', flatten: false, gzipFiles: false, keepForever: false, managedArtifacts: true, noUploadOnFailure: false, selectedRegion: 'us-east-1', showDirectlyInBrowser: false, sourceFile: "wm_test_results-*-*.txt", storageClass: 'STANDARD', uploadFromSlave: false, useServerSideEncryption: false]], pluginFailureResultConstraint: 'FAILURE', profileName: 'main', userMetadata: []
}
catch(err) {
sh '''
export machine=${NODE_NAME}
export CHANGE_ID=${CHANGE_ID}
GIT_OWNER=$(echo $GIT_URL | cut -d '/' -f4)
GIT_REPO_NAME=$(echo $GIT_URL | cut -d '/' -f5 | cut -d '.' -f1)
set +x

echo "Testing concluded...removing labels for $machine from $GIT_URL"
echo "https://api.github.com/repos/${GIT_OWNER}/${GIT_REPO_NAME}/issues/${CHANGE_ID}/labels /{$machine-RT,$machine-BL}"
#curl --silent -X DELETE -H "Accept: application/vnd.github.v3+json" -H "Authorization: Bearer ${GITHUB_TOKEN}" https://api.github.com/repos/${GIT_OWNER}/${GIT_REPO_NAME}/issues/${CHANGE_ID}/labels/{$machine-RT,$machine-BL}
'''
currentBuild.result = 'FAILURE'
}

sh '''
export machine=${NODE_NAME}
export CHANGE_ID=${CHANGE_ID}
cd ${WORKSPACE}/tests
export machine_name_logs=$(echo $machine | awk '{ print tolower($1) }')
tar --create --gzip --verbose --dereference --file "${machine_name_logs}.tgz" ${WORKSPACE}/tests/logs/*.log
'''
s3Upload consoleLogLevel: 'INFO', dontSetBuildResultOnFailure: false, dontWaitForConcurrentBuildCompletion: false, entries: [[bucket: 'noaa-epic-prod-jenkins-artifacts', excludedFile: '', flatten: true, gzipFiles: false, keepForever: false, managedArtifacts: true, noUploadOnFailure: false, selectedRegion: 'us-east-1', showDirectlyInBrowser: false, sourceFile: "**/*tgz*", storageClass: 'STANDARD', uploadFromSlave: false, useServerSideEncryption: false]], pluginFailureResultConstraint: 'FAILURE', profileName: 'main', userMetadata: []

sh "STAGE_NAME='${env.STAGE_NAME}' " + 'bash --login "${WORKSPACE}/.cicd/scripts/disk_usage.sh"'
s3Upload consoleLogLevel: 'INFO', dontSetBuildResultOnFailure: false, dontWaitForConcurrentBuildCompletion: false, entries: [[bucket: 'noaa-epic-prod-jenkins-artifacts', excludedFile: '', flatten: false, gzipFiles: false, keepForever: false, managedArtifacts: true, noUploadOnFailure: false, selectedRegion: 'us-east-1', showDirectlyInBrowser: false, sourceFile: "${UFS_PLATFORM}-*-time-wm_test.json", storageClass: 'STANDARD', uploadFromSlave: false, useServerSideEncryption: false]], pluginFailureResultConstraint: 'FAILURE', profileName: 'main', userMetadata: []
s3Upload consoleLogLevel: 'INFO', dontSetBuildResultOnFailure: false, dontWaitForConcurrentBuildCompletion: false, entries: [[bucket: 'noaa-epic-prod-jenkins-artifacts', excludedFile: '', flatten: false, gzipFiles: false, keepForever: false, managedArtifacts: true, noUploadOnFailure: false, selectedRegion: 'us-east-1', showDirectlyInBrowser: false, sourceFile: "${UFS_PLATFORM}-*-disk-usageTest.csv", storageClass: 'STANDARD', uploadFromSlave: false, useServerSideEncryption: false]], pluginFailureResultConstraint: 'FAILURE', profileName: 'main', userMetadata: []

sh "[[ -d tests/logs ]] && cd tests/logs && tar --create --gzip --verbose --dereference --file ../../wm_test_logs-${UFS_PLATFORM}-${env.UFS_COMPILER}.tgz log_${UFS_PLATFORM}/* RegressionTests_${UFS_PLATFORM}.log || cat /dev/null > ../../wm_test_logs-${UFS_PLATFORM}-${env.UFS_COMPILER}.tgz"
s3Upload consoleLogLevel: 'INFO', dontSetBuildResultOnFailure: false, dontWaitForConcurrentBuildCompletion: false, entries: [[bucket: 'noaa-epic-prod-jenkins-artifacts', excludedFile: '', flatten: false, gzipFiles: false, keepForever: false, managedArtifacts: true, noUploadOnFailure: false, selectedRegion: 'us-east-1', showDirectlyInBrowser: false, sourceFile: "wm_test_logs-${UFS_PLATFORM}-${env.UFS_COMPILER}.tgz", storageClass: 'STANDARD', uploadFromSlave: false, useServerSideEncryption: false]], pluginFailureResultConstraint: 'FAILURE', profileName: 'main', userMetadata: []
}
}
} else {
echo "Running Tests on ${nodeLabel} skipped"
}
}
stage("Post from ${nodeLabel.replaceAll("'","")}") {
if (params.WM_OPERATIONAL_TESTS != 'none' ) {
node(nodeLabel) {
script {
def UFS_PLATFORM = nodeLabel.replaceAll("'","")
try {
echo "Post Results from ${nodeLabel}"
if (baselineLabels.contains(nodeLabel)) {
//sh 'bash --login "${WORKSPACE}/.cicd/scripts/post_test_results.sh ${NODE_NAME} BL"'
sh "WM_TEST_LABEL=BL " + 'bash --login "${WORKSPACE}/.cicd/scripts/post_test_results.sh"'
}
else {
sh "WM_TEST_LABEL=RT " + 'bash --login "${WORKSPACE}/.cicd/scripts/post_test_results.sh"'
}
}
catch(err) {
echo "Error: Post Results from ${nodeLabel}"
}
}
}
}
}
}
}

def parallelStagesMap = modifiedLabels.collectEntries {
["${it}" : generateStage(it)]
}

pipeline {
agent none
parameters {
booleanParam name: 'WM_BUILD', defaultValue: false, description: 'Whether to attempt to compile the model code tests'
// Regression Test Suite ?
choice(name: 'WM_OPERATIONAL_TESTS', choices: ['default', 'control_p8', 'cpld_control_p8', 'comprehensive', 'rt.sh', 'none'], description: 'Specify the suite of tests to run')
}
environment {
ACCNR = 'epic'
AWS_PROD_ACCOUNT_ID = credentials('AWS_PROD_ACCOUNT_ID')
AWS_PROD_SNS_TOPIC = credentials('AWS_PROD_SNS_TOPIC')
GITHUB_TOKEN = credentials('GithubJenkinsNew')
GIT_URL = 'https://github.com/ufs-community/ufs-weather-model.git'
UFS_COMPILER = 'intel'
}
stages {
stage('Launch SonarQube') {
steps {
script {
echo "BRANCH_NAME=${env.CHANGE_BRANCH}"
echo "FORK_NAME=${env.CHANGE_FORK}"
echo "CHANGE_URL=${env.CHANGE_URL}"
echo "CHANGE_ID=${env.CHANGE_ID}"
build job: '/ufs-weather-model/ufs-wm-sonarqube', parameters: [
string(name: 'BRANCH_NAME', value: env.CHANGE_BRANCH ?: 'develop'),
string(name: 'FORK_NAME', value: env.CHANGE_FORK ?: ''),
string(name: 'CHANGE_URL', value: env.CHANGE_URL ?: ''),
string(name: 'CHANGE_ID', value: env.CHANGE_ID ?: '')
], wait: false
}
}
}
stage('Run Regression Tests in Parallel') {
steps {
script {
parallel parallelStagesMap
}
}
}
}
post {
success {
node('built-in') {
echo 'This will run only if successful.'
sh '''
aws sns publish --topic-arn "arn:aws:sns:us-east-1:${AWS_PROD_ACCOUNT_ID}:${AWS_PROD_SNS_TOPIC}" --region us-east-1 --message '{"version":"1.0","source":"custom","content":{"description":":sunny: Jenkins build *'"$JOB_NAME"' '"$BUILD_NUMBER"'* with *PR-'"$CHANGE_ID"'* *succeeded*"}}'
'''
}
}
failure {
node('built-in') {
echo 'This will run only if the run was marked as unstable.'
sh '''
aws sns publish --topic-arn "arn:aws:sns:us-east-1:${AWS_PROD_ACCOUNT_ID}:${AWS_PROD_SNS_TOPIC}" --region us-east-1 --message '{"version":"1.0","source":"custom","content":{"description":":warning: Jenkins build *'"$JOB_NAME"' '"$BUILD_NUMBER"'* with *PR-'"$CHANGE_ID"'* *failed!*"}}'
'''
}
}
always {
script {
// Trigger another job to collect all build statistics
CI_JOB_NAME=env.JOB_NAME.replace("/${env.BRANCH_NAME}","")
CI_BRANCH_NAME=env.BRANCH_NAME.replace("%2F","%252F")
echo "post: Triggering ufs-weather-model/ufs-wm-metrics job for ${CI_JOB_NAME} on branch build ${CI_BRANCH_NAME}/${env.BUILD_NUMBER} ..."

build job: '/ufs-weather-model/ufs-wm-metrics', parameters: [
string(name: 'CI_JOB_NAME', value: "${CI_JOB_NAME}"),
string(name: 'CI_BUILD_NUMBER', value: "${CI_BRANCH_NAME}/${env.BUILD_NUMBER}")
], wait: false

echo "#### post: ufs-weather-model/ufs-wm-metrics COMPLETE."
}
}
}
}
Loading
Loading