ci: cleanup Ganache container after tests finish

We've had too many leftover containers conflicting with new ones.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2023-05-05 17:28:29 +02:00
parent f94b071a84
commit 8fafc367eb
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
1 changed files with 16 additions and 9 deletions

View File

@ -44,14 +44,16 @@ pipeline {
} } } } } }
} }
stage('Ganache') { steps { script { stage('Ganache') {
ganache = docker.image( steps { script {
'trufflesuite/ganache:v7.4.1' ganache = docker.image(
).run( 'trufflesuite/ganache:v7.4.1'
["-p 127.0.0.1:${env.GANACHE_RPC_PORT}:8545"].join(' '), ).run(
["-m='${GANACHE_MNEMONIC}'"].join(' ') "-p 127.0.0.1:${env.GANACHE_RPC_PORT}:8545",
) "-m='${GANACHE_MNEMONIC}'"
} } } )
} }
}
stage('On-chain tests') { stage('On-chain tests') {
environment { environment {
@ -68,6 +70,11 @@ pipeline {
} } } }
success { script { github.notifyPR(true) } } success { script { github.notifyPR(true) } }
failure { script { github.notifyPR(false) } } failure { script { github.notifyPR(false) } }
cleanup { cleanWs() } cleanup { script {
cleanWs()
catchError {
ganache.stop()
}
} }
} }
} }