-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathJenkinsfile
76 lines (68 loc) · 1.8 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
71
72
73
74
75
def exec(cmd) {
if (Boolean.valueOf(env.UNIX)) {
sh cmd
}
else {
bat cmd
}
}
pipeline {
agent any
environment {
COMPOSE_FILE = "docker-compose.yml"
UNIX = isUnix()
}
tools {
//git 'git'
jdk 'jdk-8'
maven 'apache-maven-3.6.3'
//docker 'docker'
}
stages {
stage('Cloning from Github repo') {
steps {
echo 'Cloning..'
// Get some code from a GitHub repository
// git 'https://github.com/richkmeli/Richkware-Manager-Server.git'
git branch: "spring", url: 'https://github.com/richkmeli/Richkware-Manager-Server.git'
}
}
stage("Deploy env pre-build") {
steps {
exec("docker-compose up -d db")
//waitUntilServicesReady
}
}
stage('Build') {
steps {
echo 'Building..'
// Run Maven on a Unix agent. use sh
exec("mvn clean install")
}
post {
// If Maven was able to run the tests, even if some of the test
// failed, record the test results and archive the jar file.
success {
junit '**/target/surefire-reports/TEST-*.xml'
archiveArtifacts 'target/*.war'
}
}
}
stage("Deploy env post-build") {
steps {
exec("docker-compose up -d web")
//waitUntilServicesReady
}
}
stage('Test') {
steps {
echo 'Testing...'
}
}
stage('Deploy') {
steps {
echo 'Deploying....'
}
}
}
}