modification v16 jenkins
This commit is contained in:
parent
0f59d10af1
commit
169046cf2e
20
Jenkinsfile
vendored
20
Jenkinsfile
vendored
@ -69,39 +69,35 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
stage('Deploy') {
|
||||
steps {
|
||||
script {
|
||||
sshagent(credentials: [SSH_CREDENTIALS]) {
|
||||
sh '''
|
||||
ssh ${REMOTE_SERVER} << EOF
|
||||
cd ${REMOTE_WORKSPACE}/cicid
|
||||
docker pull ${DOCKER_IMAGE}:${DOCKER_TAG}
|
||||
docker stop documentation-container || true
|
||||
docker rm documentation-container || true
|
||||
docker run -d -p 3000:3000 --name documentation-container ${DOCKER_IMAGE}:${DOCKER_TAG}
|
||||
EOF
|
||||
ssh ${REMOTE_SERVER} "cd ${REMOTE_WORKSPACE}/cicid && \
|
||||
docker pull ${DOCKER_IMAGE}:${DOCKER_TAG} && \
|
||||
docker stop documentation-container || true && \
|
||||
docker rm documentation-container || true && \
|
||||
docker run -d -p 3000:3000 --name documentation-container ${DOCKER_IMAGE}:${DOCKER_TAG}"
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
stage('Update Nginx Configuration') {
|
||||
steps {
|
||||
script {
|
||||
sshagent(credentials: [SSH_CREDENTIALS]) {
|
||||
sh '''
|
||||
ssh ${REMOTE_SERVER} << EOF
|
||||
sudo nginx -t
|
||||
sudo systemctl reload nginx
|
||||
EOF
|
||||
ssh ${REMOTE_SERVER} "sudo nginx -t && sudo systemctl reload nginx"
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
post {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user