-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
50 lines (37 loc) · 1.77 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
node {
currentBuild.result = "SUCCESS"
try {
stage('Delete Repos Ibere'){
sh 'ssh [email protected] -p 5439 "rm -rf /opt/docker/ibere/"'
}
stage('Clone Repos Ibere Web e API'){
sh 'ssh [email protected] -p 5439 "git clone --depth 1 --branch master http://[email protected]/Ibere/backend.git /opt/docker/ibere/api"'
sh 'ssh [email protected] -p 5439 "git clone --depth 1 --branch master http://[email protected]/Ibere/frontend.git /opt/docker/ibere/web"'
}
stage('Down Images DB, Api and Web'){
sh 'ssh [email protected] -p 5439 "cd /opt/docker/ibere/api; docker-compose -f docker-compose-jenkins.yml down"'
}
stage('Pre Build Web'){
sh 'ssh [email protected] -p 5439 "cd /opt/docker/ibere/api;sh ./ic.sh"'
}
stage('Build and Up Docker Image Api and Web'){
sh 'ssh [email protected] -p 5439 "cd /opt/docker/ibere/api; docker-compose -f docker-compose-jenkins.yml up --build -d"'
}
stage('Success'){
mail body: 'project build successful in HML',
from: '[email protected]',
replyTo: '[email protected], [email protected]',
subject: 'Success CI Ibere',
}
}
catch (err) {
currentBuild.result = "FAILURE"
mail body: "project build error is here: ${env.BUILD_URL}" ,
from: '[email protected]',
replyTo: '[email protected], [email protected]',
subject: 'Error CI Ibere',
throw err
}
}