I have in my jenkins project the following commands:
git checkout $GIT_BRANCH
The make deploy deploys the compiled file to a folder in S3 based on the branch. So, the beta branch is deployed to s3://bucket/lib/beta/file, the master branch to s3://bucket/lib/master/file, and so on. That's why I have to checkout $GIT_BRANCH in the beginning, because make deploy needs access to the actual branch name.
Typical development has a develop branch, when the develop branch is ready for beta, the beta branch is merged into develop and pushed, then when it's ready for production that commit is merged into master and pushed.
The problem is that because the develop branch has already been tested, the Bitbucket plugin doesn't identify any changes, and so the beta and master branches don't get deployed.
I like that the plugin recognizes that there are no changes, but I need to be able to include the branch name in that test so that each branch gets built even if they are on the same commit.