-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
26 lines (24 loc) · 862 Bytes
/
Jenkinsfile
File metadata and controls
26 lines (24 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
pipeline {
agent any
environment {
DEPLOY_SERVER = 'whysano517@34.56.8.252'
DOCKER_COMPOSE_FILE = 'docker-compose.yml'
}
stages {
stage('SSH into server') {
steps {
sshagent(['service-ssh']) {
sh """
scp -o StrictHostKeyChecking=no ${DOCKER_COMPOSE_FILE} ${DEPLOY_SERVER}:/home/whysano517/
ssh -o StrictHostKeyChecking=no ${DEPLOY_SERVER} '
cd ~ &&
ls -al &&
docker compose -f ${DOCKER_COMPOSE_FILE} down --remove-orphans
docker compose -f ${DOCKER_COMPOSE_FILE} pull &&
docker compose -f ${DOCKER_COMPOSE_FILE} up -d'
"""
}
}
}
}
}