-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
99 lines (88 loc) · 2.81 KB
/
Copy pathJenkinsfile
File metadata and controls
99 lines (88 loc) · 2.81 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
pipeline {
agent any
tools {
maven 'maven_3.6.0'
}
//def mvnHome = tool name: 'maven_3.6.0', type: 'maven'
stages {
stage ('SCM Checkout') {
steps {
git 'https://github.com/Heitorh3/brewer'
}
}
stage ('Testing Stage') {
steps {
sh "mvn test"
}
}
stage ('Compile Stage') {
steps {
sh "mvn test-compile"
}
}
stage ('Building Stage') {
steps {
sh "mvn install"
}
}
stage('Example Deploy') {
when {
branch 'master'
environment name: 'DEPLOY_TO', value: 'master'
}
}
stage ('Migration database Stage') {
steps {
sh "mvn -Dflyway.user=brewer -Dflyway.password=Yw2Y4VC5drrwdMZj -Dflyway.url=jdbc:mysql://localhost/brewer?useSSL=false flyway:migrate"
}
}
production
stage('Example Production') {
when {
beforeInput true
branch 'production'
}
input {
message "Deploy to production?"
id "simple-input"
}
steps {
echo 'Production'
}
}
stage ('Package Stage') {
steps {
sh "mvn package"
stage('Push artifact') {
steps {
sh "cp target/*.war /opt/tomcat8/webapps/"
sh "/opt/tomcat8/bin/startup.sh"
}
}
stage('Publish report') {
steps {
publishHTML(target: [reportDir: 'target', reportFiles: 'index.html', reportName: 'Testes Instrumentados'])
}
}
/*
step([$class: 'CopyArtifact',
filter: 'target/brewer-1.0.0-SNAPSHOT.war',
fingerprintArtifacts: true,
allowEmptyArchive: true,
projectName: '${JOB_NAME}',
selector: lastSuccessful()
])
stage('Pull artifact') {
steps {
step([ $class: 'CopyArtifact',
filter: '*.war',
fingerprintArtifacts: true,
projectName: '${JOB_NAME}',
selector: [$class: 'SpecificBuildSelector', buildNumber: '${BUILD_NUMBER}']
])
//unzip zipFile: 'test.zip', dir: './archive_new'
//sh 'cat archive_new/test.txt'
}
}*/
}
}