I have a NodeJS project and I want to capture the BITBUCKET_BUILD_NUMBER in package.json. Can this be done in my Bitbucket pipeline build? Below is what I added to my bitbucket-pipelines.yml.
# update the package.json BUILD_NUMBER propertie
- npm pkg set BUILD_NUMBER="${BITBUCKET_BUILD_NUMBER}"
- npm pkg set description="Build Number ${BUILD_NUMBER} `date '+%Y-%m-%d %H:%M:%S'`"
- git commit package.json -m "Automated build commit on `date '+%Y-%m-%d %H:%M:%S'`"
- git push
I am getting errors on git "bash: git: command not found".
Hi John!
That error message indicates that git is not installed as part of the build image that you are using, you will either need to install git first before executing git commands or use another image that has git included.
We have an article for troubleshooting this below:
I hope this helps.
Cheers!
- Ben (Bitbucket Cloud Support)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.