mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
Laravel Vapor - Test run command to do housekeeping as part of deployment process
This commit is contained in:
Vendored
+19
@@ -77,7 +77,26 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage('Check Cleanup Status') {
|
||||
steps {
|
||||
script {
|
||||
def isCleanupRunning = sh(script: 'pgrep -f "docker image prune"', returnStatus: true) == 0
|
||||
currentBuild.description = isCleanupRunning ? 'Cleanup is already running' : 'Ready for cleanup'
|
||||
|
||||
if (isCleanupRunning) {
|
||||
currentBuild.result = 'ABORTED'
|
||||
error('Cleanup is already running. Aborting this build.')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Cleanup') {
|
||||
when {
|
||||
expression {
|
||||
return currentBuild.result != 'ABORTED'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
sh 'docker image prune -a -f'
|
||||
|
||||
Reference in New Issue
Block a user