api-cli/Jenkinsfile

28 lines
807 B
Plaintext
Raw Normal View History

2021-07-07 14:28:13 +02:00
pipeline {
agent any
environment {
NPM_REGISTRY = 'https://nexus.nclazz.de/repository/npm_releases',
NPM_CREDENTIALS = credentials('npm-publish')
NPM_MAIL = 'info@nclazz.de'
}
stages {
stage('Prepare') {
sh 'npm install -g npm-cli-login'
}
stage('Set Version') {
steps {
when { branch 'master' }
sh 'npm version patch'
sh 'git push'
}
}
stage('Deploy') {
steps {
when { tag 'v*' }
sh 'npm-cli-login -u $NPM_CREDENTIALS_USR -p $NPM_CREDENTIALS_PSW -e $NPM_MAIL -r $NPM_REGISTRY'
sh 'npm publish'
sh 'npm logout --registry=$NPM_REGISTRY'
}
}
}
}