-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
58 lines (46 loc) · 1.64 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
node() {
def mvnHome
def version
def branch
stage('Vorbereitung') {
mavenTool = 'Maven39'
jdk = 'JDK18'
branch = 'master'
version = "1.0.4.$BUILD_NUMBER"
echo "Version: ${version}"
echo "Branch: ${branch}"
// Get some code from a GitHub repository
git branch: "${branch}", credentialsId: '41cdca34-1537-4179-901d-ed553d37db44', url: 'https://github.com/fx-world/GenerationGap.git'
if (!isUnix()) {
error 'Must build with linux'
}
}
stage('Maven') {
withMaven(jdk: jdk, maven: mavenTool, options: [artifactsPublisher(disabled: true)]) {
sh('mvn -Dmaven.test.failure.ignore clean package')
}
}
stage('Ausgabe') {
archiveArtifacts '**/target/*repository*.zip'
withMaven(jdk: jdk, maven: mavenTool, options: [artifactsPublisher(disabled: true)]) {
sh('mvn -Dmaven.test.failure.ignore -P deployNightly install')
}
}
stage('Release') {
def doRelease = true
try {
timeout(time:1, unit:'DAYS') {
input message:'Approve release?', submitter: 'fx'
}
} catch (err) {
// its ok
doRelease = false
}
if (doRelease == true) {
withMaven(jdk: jdk, maven: mavenTool, options: [artifactsPublisher(disabled: true)]) {
sh('mvn -Dmaven.test.failure.ignore -P deployRelease install')
}
// mvn(localRepository, '-P deployRelease -f ./jars/generationgap-maven-plugin/pom.xml deploy -DskipTests -Dbuildnumber='+buildnumber)
}
}
}