forked from zowe/sample-node-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
63 lines (52 loc) · 1.86 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
#!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 2020
*/
node('zowe-jenkins-agent-dind') {
def lib = library("jenkins-library").org.zowe.jenkins_shared_library
def pipeline = lib.pipelines.nodejs.NodeJSPipeline.new(this)
pipeline.admins.add("stevenh")
pipeline.setup(
packageName: 'org.zowe.sample-node-api',
nodeJsVersion: 'v10.18.1',
installRegistries: [
[
email : lib.Constants.DEFAULT_LFJ_NPM_PRIVATE_REGISTRY_EMAIL,
usernamePasswordCredential : lib.Constants.DEFAULT_LFJ_NPM_PRIVATE_REGISTRY_CREDENTIAL,
registry : lib.Constants.DEFAULT_LFJ_NPM_PRIVATE_REGISTRY_INSTALL,
]
],
publishRegistry: [
email : lib.Constants.DEFAULT_LFJ_NPM_PRIVATE_REGISTRY_EMAIL,
usernamePasswordCredential : lib.Constants.DEFAULT_LFJ_NPM_PRIVATE_REGISTRY_CREDENTIAL,
]
)
pipeline.build()
// we need sonar scan
// failBuild set to false whilst investigating https://github.com/zowe/zlux/issues/285
pipeline.sonarScan(
scannerTool : lib.Constants.DEFAULT_LFJ_SONARCLOUD_SCANNER_TOOL,
scannerServer : lib.Constants.DEFAULT_LFJ_SONARCLOUD_SERVER,
allowBranchScan : lib.Constants.DEFAULT_LFJ_SONARCLOUD_ALLOW_BRANCH,
failBuild : false
)
// we have pax packaging step
pipeline.packaging(name: 'sample-node-api')
// define we need publish stage
pipeline.publish(
operation: {
echo "Default npm publish will be skipped."
},
artifacts: [
'.pax/sample-node-api.pax'
],
allowPublishWithoutTest: true // There are no tests
)
pipeline.end()
}