-
Notifications
You must be signed in to change notification settings - Fork 85
/
Jenkinsfile
70 lines (52 loc) · 1.63 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
pipeline {
agent any
environment {
APP_NAME = 'DDD'
}
stages {
stage("Checkout") {
steps {
checkout scm
}
}
stage("Environment") {
steps {
sh 'docker pull jorge07/alpine-php:7.1-dev-sf'
sh "docker-compose -f etc/infrastructure/build/docker-compose.yml pull"
sh "docker-compose -f etc/infrastructure/build/docker-compose.yml build"
sh "docker-compose -f etc/infrastructure/build/docker-compose.yml up -d"
}
}
stage("Build") {
steps {
sh "docker exec build_fpm_1 ant build"
}
}
stage("Tests") {
steps {
parallel(
"Acceptation": {
sh "docker exec build_fpm_1 curl nginx"
sh "docker exec build_fpm_1 ant acceptation"
},
"Unit and functional": {
sh "docker exec build_fpm_1 ant unit-and-functional"
}
)
}
}
}
post {
success {
echo 'ok'
// slackSend (color: '#43A047', message: "${env.APP_NAME} -> All green. See: (${env.BUILD_URL})")
}
failure {
echo 'ko'
// slackSend (color: '#CF0000', message: "${env.APP_NAME} -> Ops! Something was wrong... See: (${env.BUILD_URL})")
}
always {
sh "docker-compose -f etc/infrastructure/build/docker-compose.yml down --volumes"
}
}
}