Skip to content

Commit 56a08e0

Browse files
a-szegelshijin-aws
authored andcommitted
contrib/aws: Simplify Jenkinsfile
Get rid of unstable b/c our jobs are either pass/fail. Get rid of try/catch when calling shell scripts with throw b/c we don't need to do anything afterwards. Signed-off-by: Seth Zegelstein <[email protected]>
1 parent b66e9d1 commit 56a08e0

File tree

1 file changed

+12
-37
lines changed

1 file changed

+12
-37
lines changed

contrib/aws/Jenkinsfile

Lines changed: 12 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,11 @@ def download_and_extract_portafiducia(outputDir) {
2323
/* Download PortaFiducia tarball from S3 and extract to outputDir */
2424
def tempPath = "/tmp/portafiducia.tar.gz"
2525
def downloadPath = this.get_portafiducia_download_path()
26-
27-
def ret = sh (
28-
script: "mkdir -p ${outputDir} && aws s3 cp ${downloadPath} ${tempPath} && " +
29-
"tar xf ${tempPath} -C ${outputDir}",
30-
returnStatus: true,
31-
)
32-
33-
if (ret != 0) {
34-
unstable('Failed to download and extract PortaFiducia')
35-
}
26+
sh """
27+
mkdir -p ${outputDir}
28+
aws s3 cp ${downloadPath} ${tempPath}
29+
tar xf ${tempPath} -C ${outputDir}
30+
"""
3631
}
3732

3833
def install_porta_fiducia() {
@@ -55,17 +50,7 @@ def run_test_orchestrator_once(run_name, build_tag, os, instance_type, instance_
5550
*/
5651
def cluster_name = get_cluster_name(build_tag, os, instance_type)
5752
def args = "--config configs/${test_config_file} --os ${os} --instance-type ${instance_type} --instance-count ${instance_count} --region ${region} --cluster-name ${cluster_name} ${addl_args} --junit-xml outputs/${cluster_name}.xml"
58-
def ret = sh (
59-
script: ". venv/bin/activate; cd PortaFiducia/tests && ./test_orchestrator.py ${args}",
60-
returnStatus: true
61-
)
62-
if (ret == 65)
63-
unstable('Scripts exited with status 65')
64-
else if (ret != 0)
65-
build_ok = false
66-
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
67-
sh "exit ${ret}"
68-
}
53+
sh ". venv/bin/activate; cd PortaFiducia/tests && ./test_orchestrator.py ${args}"
6954
}
7055

7156
def get_random_string(len) {
@@ -102,22 +87,12 @@ def get_single_node_windows_test_stage(stage_name) {
10287
*/
10388
return {
10489
stage("${stage_name}") {
105-
def ret = sh (
106-
script: """
107-
. venv/bin/activate;
108-
cd PortaFiducia/scripts;
109-
export PULL_REQUEST_ID=${env.CHANGE_ID};
110-
env AWS_DEFAULT_REGION=us-west-2 ./test_orchestrator_windows.py --ci public --s3-bucket-name libfabric-ci-windows-prod-test-output --pull-request-id ${env.CHANGE_ID};
111-
""",
112-
returnStatus: true
113-
)
114-
if (ret == 65)
115-
unstable('Scripts exited with status 65')
116-
else if (ret != 0)
117-
build_ok = false
118-
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
119-
sh "exit ${ret}"
120-
}
90+
sh """
91+
. venv/bin/activate;
92+
cd PortaFiducia/scripts;
93+
export PULL_REQUEST_ID=${env.CHANGE_ID};
94+
env AWS_DEFAULT_REGION=us-west-2 ./test_orchestrator_windows.py --ci public --s3-bucket-name libfabric-ci-windows-prod-test-output --pull-request-id ${env.CHANGE_ID};
95+
"""
12196
}
12297
}
12398

0 commit comments

Comments
 (0)