using bitbucket’s bitbuckettag variable in an if statement will solve an overhead problem

The problem is the way you have coded the "if" statement:

if [ $BITBUCKET_TAG == 'test-*' ];

This is a bash/unix if statement, which will check for a literal string "test-*" as the branch name, which you probably don’t use.

You should use a ‘string contains’ test instead of a ‘string equals’ test, like this:

if [[ $BITBUCKET_TAG == *"test-"* ]];

Also note that the yml usage of 'test-*' here…


… is different to how a bash/shell script interprets 'test-*'.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top