node { stage('Preparation') { git branch: 'develop', credentialsId: '490ebead-8319-4c6f-af23-443ef8f5465a', url: 'git@bitbucket.org:alertclickbuy/data-access.git' } stage('Build') { withNPM(npmrcConfig: '9e686953-e54d-4f65-893e-becf40f4d6af') { sh 'yarn' } } stage('Test') { withEnv(['DB_USERNAME=postgres', 'DB_PASSWORD=mysecretpassword', 'DB_DATABASE=postgres', 'DB_HOST=localhost']) { sh 'yarn bootstrap' sh 'yarn test' } } stage('Deploy') { withNPM(npmrcConfig: '9e686953-e54d-4f65-893e-becf40f4d6af') { sh 'npm --no-git-tag-version version patch' sh 'npm publish' } } }