#!groovy // Load shared pipeline library @Library('velox') _ properties([ // Only keep Jenkins builds around for 14 days buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '14', numToKeepStr: '')), parameters([ string(name: 'APIM_MANAGEMENT', defaultValue: '', description: 'The V5 API Management Server with the default test data'), string(name: 'APIM_USERNAME', defaultValue: '', description: 'Username to login to api manager'), string(name: 'APIM_PASSWORD', defaultValue: '7iron-hide', description: 'Password to login to api manager'), booleanParam(name: 'RUN_NODE_8_TEST', defaultValue: true, description: 'Run Node 8 tests'), booleanParam(name: 'RUN_NODE_10_TEST', defaultValue: true, description: 'Run Node 10 tests'), choice( name: 'npm_config_registry', description: 'NPM registry to install dependencies from. CI (default), or release-staging.', choices: [ 'http://apic-ci-npm.hursley.ibm.com:4873/', // ci registry 'http://apim-ci1.rtp.raleigh.ibm.com:8080/', // staging registry ], ), ]), ]) // abort build if these parameters aren't given assert params.APIM_MANAGEMENT assert params.APIM_USERNAME veloxPipeline { p -> env.CAPTURING_LOGGER = 'true' stage('node 8') { if (params.RUN_NODE_8_TEST) { p.useNode('8') sh ''' git clean -fxd npm install --prefer-offline npm test npm run server-test ''' } } stage('node 10') { if (params.RUN_NODE_10_TEST) { p.useNode('10') sh ''' git clean -fxd npm install --prefer-offline npm test npm run server-test ''' } } }