-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
53 lines (42 loc) · 1.31 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
boolean isRelease = env.BRANCH_NAME == 'main' || env.BRANCH_NAME == 'main-jee8'
String suffix = env.BRANCH_NAME == 'main-jee8' ? '-jee8' : ''
config {
cronTrigger = ""
}
def mvn = new nl.topicus.MavenCommands()
node() {
git.checkout {}
catchError {
if (isRelease) {
stage('Release') {
git.branch("current-build")
def release = mvn.createBuildTimestamp('yyyy.MM.dd.HHmmss') + suffix
def nextRelease = mvn.createBuildTimestamp('yyyy.MM') + "-SNAPSHOT"
def skipRelease = sh ( script: "git log -1 | grep '@release\\.skip'", returnStatus: true )
if ( skipRelease != 0 ) {
maven.release {
releaseVersion = release
tagNameFormat = "vakkentabel-maven-plugin-$release"
options = "-DignoreSnapshots=true -DdevelopmentVersion=$nextRelease -Darguments=\"-Denforcer.skip -DskipTests\""
}
sh """git remote add ssh-origin [email protected]:topicusonderwijs/vakkentabel-maven-plugin.git || echo This is fine"""
git.push("ssh-origin", "vakkentabel-maven-plugin-$release")
} else {
echo "Skipping release due to @release.skip in commit message"
maven {
goals = 'verify'
}
}
}
} else {
maven {
goals = 'verify'
}
}
}
reportIssues()
notify {
slackChannel = "#somtoday-dev"
emailNotificationRecipients = '[email protected]'
}
}