From 8fafc367eb48ae091c58a24cdfd1dd4412c8240c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Fri, 5 May 2023 17:28:29 +0200 Subject: [PATCH] ci: cleanup Ganache container after tests finish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We've had too many leftover containers conflicting with new ones. Signed-off-by: Jakub SokoĊ‚owski --- ci/Jenkinsfile.tests | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/ci/Jenkinsfile.tests b/ci/Jenkinsfile.tests index bc40ee33..c08fcf43 100644 --- a/ci/Jenkinsfile.tests +++ b/ci/Jenkinsfile.tests @@ -44,14 +44,16 @@ pipeline { } } } } - stage('Ganache') { steps { script { - ganache = docker.image( - 'trufflesuite/ganache:v7.4.1' - ).run( - ["-p 127.0.0.1:${env.GANACHE_RPC_PORT}:8545"].join(' '), - ["-m='${GANACHE_MNEMONIC}'"].join(' ') - ) - } } } + stage('Ganache') { + steps { script { + ganache = docker.image( + 'trufflesuite/ganache:v7.4.1' + ).run( + "-p 127.0.0.1:${env.GANACHE_RPC_PORT}:8545", + "-m='${GANACHE_MNEMONIC}'" + ) + } } + } stage('On-chain tests') { environment { @@ -68,6 +70,11 @@ pipeline { } } success { script { github.notifyPR(true) } } failure { script { github.notifyPR(false) } } - cleanup { cleanWs() } + cleanup { script { + cleanWs() + catchError { + ganache.stop() + } + } } } }