1 | #!groovy
|
2 |
|
3 | // Load shared pipeline library
|
4 | @Library('velox') _
|
5 |
|
6 | properties([
|
7 | // Only keep Jenkins builds around for 14 days
|
8 | buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '14', numToKeepStr: '')),
|
9 | parameters([
|
10 | string(name: 'APIM_MANAGEMENT', defaultValue: '', description: 'The V5 API Management Server with the default test data'),
|
11 | string(name: 'APIM_USERNAME', defaultValue: '', description: 'Username to login to api manager'),
|
12 | string(name: 'APIM_PASSWORD', defaultValue: '7iron-hide', description: 'Password to login to api manager'),
|
13 | choice(
|
14 | name: 'npm_config_registry',
|
15 | description: 'NPM registry to install dependencies from. CI (default), or release-staging.',
|
16 | choices: [
|
17 | 'http://apic-ci-npm.hursley.ibm.com:4873/', // ci registry
|
18 | 'http://apim-ci1.rtp.raleigh.ibm.com:8080/', // staging registry
|
19 | ],
|
20 | ),
|
21 | ]),
|
22 | ])
|
23 |
|
24 | // abort build if these parameters aren't given
|
25 | assert params.APIM_MANAGEMENT
|
26 | assert params.APIM_USERNAME
|
27 |
|
28 | veloxPipeline { p ->
|
29 |
|
30 | env.CAPTURING_LOGGER = 'true'
|
31 |
|
32 | stage('node 14') {
|
33 | p.useNode('14')
|
34 | sh '''
|
35 | git clean -fxd
|
36 | npm install --prefer-offline
|
37 | npm test
|
38 | npm run server-test
|
39 | '''
|
40 | }
|
41 |
|
42 | }
|