Merge pull request 'fix' (#33) from feature/task-30-docker into master
Hedgehog_server_CD/ServerMonitorBot/pipeline/head This commit looks good Details

Reviewed-on: #33
pull/35/head
L_DelOff 2023-11-22 18:51:11 +03:00
commit 30772ec123
1 changed files with 10 additions and 6 deletions

View File

@ -31,14 +31,18 @@ pipeline {
}
}
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'
"""
steps {
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'
"""
steps {
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 {