-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile_native
66 lines (58 loc) · 1.75 KB
/
Jenkinsfile_native
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
pipeline {
agent any
stages {
stage('Init') {
steps {
echo 'Inizio a buildare Hackubau Docx'
}
}
stage('Build') {
steps {
sh 'mvn clean package -DskipTests'
archiveArtifacts(artifacts: 'target\\*.jar', onlyIfSuccessful: true)
archiveArtifacts(artifacts: 'pom.xml', onlyIfSuccessful: true)
archiveArtifacts(artifacts: 'src\\main\\resources\\*', onlyIfSuccessful: true)
}
}
stage('Test') {
steps {
warnError(message: 'Errore nei test - release instabile') {
sh 'mvn surefire-report:report'
junit 'target/surefire-reports/*.xml'
}
}
}
stage('Manual Approvation') {
steps {
input 'Procedi al deploy in quality?'
}
}
stage('Nexus Upload') {
steps {
nexusArtifactUploader(nexusVersion: 'nexus3',
protocol: 'http',
nexusUrl: 'localhost:8081/repository/maven-releases',
groupId: 'it.hackubau',
version: '1',
repository: 'hck',
credentialsId: '4dfa3a50-c33c-4539-bc7f-b4e5558c056d',
artifacts: [
[artifactId: 'hackubau-docs',
classifier: '',
file: "target/hackubau-docs-1.0-RELEASE.jar",
type: 'jar']
])
}
}
stage('Database migration') {
steps {
sh 'sudo flyway -configFiles=DevOps/flyway.conf migrate'
}
}
stage('Deploy with ansible') {
steps {
ansiblePlaybook(playbook: 'DevOps/playbook.yml', inventory: 'DevOps/hosts')
}
}
}
}