-
-
Save alanhg/fcdf6daeb9ded0e5427578f5aafdf023 to your computer and use it in GitHub Desktop.
Jenkins持续集成-发布NPM新包
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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