#!groovy

// Load shared pipeline library
@Library('velox') _

properties([
    // Only keep Jenkins builds around for 14 days
    buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '14', numToKeepStr: '')),
    parameters([
        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
            ],
        ),
    ]),
])

veloxPipeline { p ->
    
    env.CAPTURING_LOGGER = 'true'
		
    stage('node 14') {
        p.useNode('14')
        sh '''
            git clean -fxd
            npm install --prefer-offline
            npm test
            npm run server-test
        '''
    }

}
