-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jekinsfile
86 lines (74 loc) · 2.4 KB
/
Jekinsfile
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
84
85
86
pipeline {
agent any
tools {
maven "M3"
}
stages {
stage('Cleaning workspace') {
steps {
cleanWs()
}
}
stage('Pull Code') {
steps {
sh "pwd"
sh "mkdir dev_code"
sh "mkdir test_code"
dir("dev_code") {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/AnjiB/anji-kot-lin']]])
}
dir("test_code") {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/AnjiB/anji-lytweight-rest-api-framework']]])
}
sh "ls"
}
}
stage('Build Dev Environement') {
steps {
sh "pwd"
sh "ls"
dir("dev_code") {
sh "ls"
sh "./gradlew clean build"
sh "./gradlew run &"
sh "echo waiting for 30 seconds"
sleep(time:30, unit:"SECONDS")
sh "curl -v http://localhost:9000/"
}
}
}
stage('Build Test Project') {
steps {
sh "pwd"
dir("test_code") {
sh "ls"
sh "mvn clean install -DskipTests"
}
}
}
stage('Run E2E tests') {
steps {
sh "pwd"
dir("test_code") {
sh "mvn test -Pe2e -DautEnvironment=QA -DenableLogs=true"
}
}
}
}
post {
always {
junit(
allowEmptyResults: true,
testResults: '**/surefire-reports/TEST-*.xml'
)
publishHTML ([
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: 'test_code/target/surefire-reports/',
reportFiles: 'emailable-report.html',
reportName: 'RCov Report'
])
}
}
}