-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathJenkinsfile_allinone
More file actions
83 lines (83 loc) · 1.7 KB
/
Jenkinsfile_allinone
File metadata and controls
83 lines (83 loc) · 1.7 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
pipeline{
agent{
node{
label '611177209'
}
}
options {
skipDefaultCheckout(true)
}
stages{
stage('Clean old DOCs & chekcout SCM'){
steps{
cleanWs()
checkout scm
}
}
stage('verify tools'){
steps{
sh '''
docker info
docker version
docker-compose version
'''
}
}
stage('Start Container'){
steps{
sh '''
docker-compose up -d
'''
}
}
stage('Dependency installation'){
steps{
sh '''
docker-compose exec -T ci4_service sh -c "cd /app && composer install"
docker-compose restart
'''
}
}
stage('Environment Setting Up'){
steps{
script{
sh '''
cp app/env app/.env
'''
}
}
}
stage('Database migrate'){
steps{
sh '''
docker-compose exec -T ci4_service sh -c "php spark migrate"
'''
}
}
stage('Database seed'){
steps{
sh '''
sleep 2
docker-compose exec -T ci4_service sh -c "php spark migrate"
docker-compose exec -T ci4_service sh -c "php spark db:seed Members"
docker-compose exec -T ci4_service sh -c "php spark db:seed TodoLists"
docker-compose up -d
'''
}
}
stage('Unit testing'){
steps{
sh '''
docker-compose exec -T ci4_service sh -c "vendor/bin/phpunit --log-junit build/logs/blogger_unitTest.xml"
ls
'''
junit 'app/build/logs/blogger_unitTest.xml'
}
}
}
post {
always {
sh 'docker-compose down'
}
}
}