Skip to content

Instantly share code, notes, and snippets.

@alanhg
Created January 7, 2021 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alanhg/fcdf6daeb9ded0e5427578f5aafdf023 to your computer and use it in GitHub Desktop.
Save alanhg/fcdf6daeb9ded0e5427578f5aafdf023 to your computer and use it in GitHub Desktop.
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