Created
August 16, 2019 12:17
-
-
Save ridakk/23909efdd52c6ecce1c3fa07e68c7347 to your computer and use it in GitHub Desktop.
jenkinsfile scm with local branch to push remote repository
This file contains hidden or 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('[email protected]') { | |
stage('checkout') { | |
checkout([ | |
$class: 'GitSCM', | |
branches: [[name: '*/development']], // solves detached head issue | |
extensions: [[$class: 'LocalBranch', localBranch: '**']], // required to push changes to remote repo | |
userRemoteConfigs: scm.userRemoteConfigs | |
]) | |
} | |
stage('npm install') { | |
sh 'npm install' | |
} | |
stage('npm version') { | |
sh "npm run release" | |
} | |
stage('push to bitbucket') { | |
sh "git push --follow-tags origin development" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment