Merge pull request #1159 from status-im/jenkins

Jenkins: archive testnet logs as artifacts
This commit is contained in:
Ștefan Talpalaru 2020-06-11 01:41:16 +02:00 committed by GitHub
commit 7aec3dfc4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 3 deletions

15
Jenkinsfile vendored
View File

@ -40,8 +40,8 @@ def runStages() {
// EXECUTOR_NUMBER will be 0 or 1, since we have 2 executors per Jenkins node
sh """#!/bin/bash
set -e
timeout -k 20s 10m ./scripts/launch_local_testnet.sh --testnet 0 --nodes 4 --log-level INFO --disable-htop --base-port \$(( 9000 + EXECUTOR_NUMBER * 100 )) --base-metrics-port \$(( 8008 + EXECUTOR_NUMBER * 100 )) -- --verify-finalization --stop-at-epoch=5
timeout -k 20s 40m ./scripts/launch_local_testnet.sh --testnet 1 --nodes 4 --log-level INFO --disable-htop --base-port \$(( 9000 + EXECUTOR_NUMBER * 100 )) --base-metrics-port \$(( 8008 + EXECUTOR_NUMBER * 100 )) -- --verify-finalization --stop-at-epoch=5
timeout -k 20s 10m ./scripts/launch_local_testnet.sh --testnet 0 --nodes 4 --log-level INFO --disable-htop --data-dir local_testnet0_data --base-port \$(( 9000 + EXECUTOR_NUMBER * 100 )) --base-metrics-port \$(( 8008 + EXECUTOR_NUMBER * 100 )) -- --verify-finalization --stop-at-epoch=5
timeout -k 20s 40m ./scripts/launch_local_testnet.sh --testnet 1 --nodes 4 --log-level INFO --disable-htop --data-dir local_testnet1_data --base-port \$(( 9000 + EXECUTOR_NUMBER * 100 )) --base-metrics-port \$(( 8008 + EXECUTOR_NUMBER * 100 )) -- --verify-finalization --stop-at-epoch=5
"""
}
}
@ -49,10 +49,19 @@ def runStages() {
)
}
} catch(e) {
echo "'${env.STAGE_NAME}' stage failed"
// we need to rethrow the exception here
throw e
} finally {
// archive testnet logs
if ("${NODE_NAME}" ==~ /linux.*/) {
sh """#!/bin/bash
for D in local_testnet0_data local_testnet1_data; do
[[ -d "\$D" ]] && tar cjf "\${D}.tar.bz2" "\${D}"/*.txt
done
"""
archiveArtifacts("*.tar.bz2")
}
// clean the workspace
cleanWs(disableDeferredWipeout: true, deleteDirs: true)
}
}