-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile
79 lines (62 loc) · 1.9 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!groovy
/**
* This program and the accompanying materials are made available under the terms of the
* Eclipse Public License v2.0 which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-v20.html
*
* SPDX-License-Identifier: EPL-2.0
*
* Copyright IBM Corporation 2018, 2019
*/
node('zowe-jenkins-agent') {
def lib = library("jenkins-library").org.zowe.jenkins_shared_library
def pipeline = lib.pipelines.generic.GenericPipeline.new(this)
pipeline.branches.addMap([
[
name : 'staging',
isProtected: true,
allowRelease: true,
allowFormalRelease: false,
releaseTag: 'SNAPSHOT'
],
[
name : 'master',
isProtected: true,
allowFormalRelease: true,
allowRelease: true,
releaseTag: ''
]
])
pipeline.admins.add("markackert", "Vit")
pipeline.setup(
packageName: 'org.zowe.keyring-utilities',
extraInit: {
def packageJson = readJSON(file: 'package.json')
def version
// if we're not on master, SNAPSHOT
/* if (!env.BRANCH_NAME.equalsIgnoreCase("master")) {
version = packageJson['version'] + "-SNAPSHOT"
}
else {
version = packageJson['version']
}*/
pipeline.setVersion(packageJson['version'])
}
)
pipeline.build(
operation: {
echo "Build will happen in pre-packaging"
}
)
// define we need packaging stage, which processed in .pax folder
pipeline.packaging(name: 'keyring', extraFiles: 'keyring-util')
// define we need publish stage
pipeline.publish(
allowPublishWithoutTest: true,
artifacts: [
'.pax/keyring-util',
]
)
pipeline.release()
pipeline.end()
}