Merge pull request 'Удаление старых образов перед деплоем' (#32) from feature/task-30-docker into master
Hedgehog_server_CD/ServerMonitorBot/pipeline/head There was a failure building this commit
Details
Hedgehog_server_CD/ServerMonitorBot/pipeline/head There was a failure building this commit
Details
Reviewed-on: #32pull/35/head
commit
5b0decff19
|
@ -30,12 +30,15 @@ pipeline {
|
|||
sh 'mvn -B -DskipTests -X clean package spring-boot:repackage'
|
||||
}
|
||||
}
|
||||
stage('Prune images pre') {
|
||||
steps {
|
||||
sh """
|
||||
sshpass -p ${SSH_PASS} ssh -o StrictHostKeyChecking=no ${SSH_USER}@${SSH_HOST} -p ${SSH_PORT} 'docker image prune --all --force'
|
||||
"""
|
||||
}
|
||||
stage('Stop container') {
|
||||
sh """
|
||||
sshpass -p ${SSH_PASS} ssh -o StrictHostKeyChecking=no ${SSH_USER}@${SSH_HOST} -p ${SSH_PORT} 'cd ${PATH_TO_DEV_FOLDER} && docker compose down'
|
||||
"""
|
||||
}
|
||||
stage('Remove old image') {
|
||||
sh """
|
||||
sshpass -p ${SSH_PASS} ssh -o StrictHostKeyChecking=no ${SSH_USER}@${SSH_HOST} -p ${SSH_PORT} 'docker image rm -f ${IMAGE_NAME}:${IMAGE_VERSION} || true'
|
||||
"""
|
||||
}
|
||||
stage('Deploy') {
|
||||
steps {
|
||||
|
@ -52,7 +55,7 @@ pipeline {
|
|||
}
|
||||
}
|
||||
}
|
||||
stage('Prune images post') {
|
||||
stage('Remove useless images') {
|
||||
steps {
|
||||
sh """
|
||||
sshpass -p ${SSH_PASS} ssh -o StrictHostKeyChecking=no ${SSH_USER}@${SSH_HOST} -p ${SSH_PORT} 'docker image prune --all --force'
|
||||
|
|
Loading…
Reference in New Issue