withCredentials([usernamePassword(credentialsId: '****', usernameVariable: 'ACCESS_TOKEN_USERNAME', passwordVariable: 'ACCESS_TOKEN_PASSWORD',)]) {
sh "curl -X PUT -d '{\"commit_title\": \"Merge pull request\"}' https://***/pulls/$CHANGE_ID/merge?access_token=$ACCESS_TOKEN_PASSWORD"
}
git config --global user.name '****'
git config --global user.email ****
git commit -am 'Bumped version number'
git remote set-url origin git@****.git
git push origin mastergit push '****:****@https://github.****.git/'
git remote set-url origin https://****:****@github.****.git git push origin master
git remote set-url origin git@github.****.com:****.git + git push origin master Host key verification failed. fatal: Could not read from remote repository.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/16980860-a0fc-42d0-b091-eb5f607001fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/193a2714-f9f3-48c5-8eb8-06df36c4febc%40googlegroups.com.
gitPublisher branchesToPush: [[branchName: 'master']], credentialsId: 'caf2691d-42c7-4d10-acf0-cf5fcc2575a4', url: '****'sh "npm --no-git-tag-version version minor"
// commit the updated version number back to GHE
sh "git commit -am 'Bumped version number [ci skip]'"
gitPublisher branchesToPush: [[branchName: 'master']], credentialsId: 'caf2691d-42c7-4d10-acf0-cf5fcc2575a4', url: 'https://***'To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f94f0eab-895d-4b54-bf95-7c2270b2234f%40googlegroups.com.
stage ("Publish to npm") {
steps {
script {
STAGE_NAME = "Publish to npm"
}
// Prepare the workspace
deleteDir()
sh '''
git checkout -b master
npm --no-git-tag-version version minor
git commit -am 'Bumped version number [ci skip]'
git push origin master
'''
}
}
}sh 'git checkout ' + env.BRANCH_NAME
stage ("Publish to npm") {
steps {
script {
STAGE_NAME = "Publish to npm"
if (BRANCH_NAME == "master") {
// Publish to npm and bump the version number for the next release
sh "npm publish"
deleteDir()
sshagent (credentials: ['e276113e-0ec9-4eaa-88f9-a7db5c9635b6']) {
sh '''
git clone git@****.git
cd ****
npm --no-git-tag-version version minor
git config --global user.name "****"
git config --global user.email ****
git commit -am 'Bumped version number [ci skip]'
git push origin master
'''
}
slackSend (
color: '#199515',
message: "$JOB_NAME: Build #$BUILD_NUMBER passed successfully."
)
}
else {
echo "Not in 'master' branch. Don't attempt publishing."
}
}
}
}
}