-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathJenkinsfile
More file actions
54 lines (44 loc) · 1.42 KB
/
Jenkinsfile
File metadata and controls
54 lines (44 loc) · 1.42 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
#!groovy
@Library('github.com/cloudogu/ces-build-lib@4.2.0')
import com.cloudogu.ces.cesbuildlib.*
// Creating necessary git objects
git = new Git(this, "cesmarvin")
git.committerName = 'cesmarvin'
git.committerEmail = 'cesmarvin@cloudogu.com'
gitflow = new GitFlow(this, git)
github = new GitHub(this, git)
changelog = new Changelog(this)
makefile = new Makefile(this)
// Configuration of repository
repositoryOwner = "cloudogu"
repositoryName = "makefiles"
project = "github.com/${repositoryOwner}/${repositoryName}"
// Configuration of branches
productionReleaseBranch = "master"
developmentBranch = "develop"
currentBranch = "${env.BRANCH_NAME}"
node('') {
timestamps {
stage('Checkout') {
checkout scm
make 'clean'
}
stage('Check Makefiles') {
// Dry-run make to check for errors in Makefiles
make '-n'
}
if (gitflow.isReleaseBranch()) {
String controllerVersion = makefile.getVersion()
String releaseVersion = "v${controllerVersion}".toString()
stage('Finish Release') {
gitflow.finishRelease(releaseVersion, productionReleaseBranch)
}
stage('Add Github-Release') {
releaseId = github.createReleaseWithChangelog(releaseVersion, changelog, productionReleaseBranch)
}
}
}
}
void make(String makeArgs) {
sh "make ${makeArgs}"
}