I have a npm module project that also provides a docker image. I want to trigger the build/test/push of a docker image when package.json
version changes.
I'm after a bash script that will identify whether the version in my package.json
has changed.
I can tell if the file has changed with something such as $(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)
scripts that use node are ok since I have the node bin on the build server already, for example, PACKAGE_VERSION=$(node -p -e "require('./package.json').version")