-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
executable file
·35 lines (34 loc) · 1.11 KB
/
Jenkinsfile
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
27
28
29
30
31
32
33
34
35
pipeline {
agent any
stages {
stage('Deploy Dev environment') {
steps {
sh '''
ssh -i /var/jenkins_home/.ssh/id_rsa.metadap -o StrictHostkeyChecking=no [email protected] "cd Projects/metadap_landing_page; \
git checkout main; \
git pull; \
docker-compose down; \
docker-compose up -d --build"
'''
}
}
stage('Deploy Prod environment') {
options {
timeout(time: 1, unit: 'HOURS')
}
input{
message "Shall we deploy to Production?"
ok "Yes Please"
}
steps {
sh '''
ssh -i /var/jenkins_home/.ssh/id_rsa.metadap -o StrictHostkeyChecking=no [email protected] "cd Projects/metadap_landing_page; \
git checkout main; \
git pull; \
docker-compose down; \
docker-compose up -d --build"
'''
}
}
}
}