I have a node project. What I want to do is on a developer checkin (commit and push), I want to run the bitbucket pipeline which would internally do the following
- npm install and npm test
- npm version patch (to increment the version in the package.json)
- git push origin master --follow-tags
- npm publish
bitbucket-pipelines.yml
image: node:8
pipelines:
default:
- step:
caches:
- node
script:
- npm version patch
- git push origin develop --follow-tags
- npm publish
I am facing problem on the "git push origin master --follow-tags". How do I give pipeline the permission to push back to the repository?
Also I want to know if this will trigger a cycle, where my bitbucket pipeline executes again since I incremented the package.json version and did a check in (commit and push)?
What is the recommended way of doing CI/CD With version number increments on a nodejs project using bitbucket-pipelines?
Cheers, Rohit