Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Jenkins持续集成-发布NPM新包
node() {
nodejs(nodeJSInstallationName: "nodejs_v10.16.0", configId: "96de5baa-02b1-4cb9-9f65-e8f96452b59c") {
stage("checkout") {
checkout([$class: 'GitSCM', branches: [
[name: 'master']
], userRemoteConfigs: [
[credentialsId: 'gitlab', url: 'git@gitlab.1991421.cn:personal/hello-web.git']
]])
}
stage("release lib") {
sshagent( ['gitlab']) {
sh '''
git config --global user.email "alan@1991421.cn"
git config --global user.name "Alan's 2st Bot"
npm install -g yarn
yarn install
npm run release
git push origin HEAD:refs/heads/master --tags
'''
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment