Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Previously working pipeline bash now fails

Kareem Straker January 14, 2020

I'm having a strange issue with Bitbucket Pipelines, where a previously working pipeline now fails without warning.

In this particular case I am, using bash, incrementing a variable of `0`.

(( VERSION_NUMBER_LIST[1]++ )); echo "${VERSION_NUMBER_LIST[0]}.${VERSION_NUMBER_LIST[1]} list version incremented";

 

What is especially confusing is that this worked fine before, and works in my local testing:

VERSION_NUMBER_OLD=0.0

IFS='.' read -ra VERSION_NUMBER_LIST <<< "$VERSION_NUMBER_OLD"; echo "${VERSION_NUMBER_LIST[0]}.${VERSION_NUMBER_LIST[1]} list version";
0.0 list version

(( VERSION_NUMBER_LIST[1]++ )); echo "${VERSION_NUMBER_LIST[0]}.${VERSION_NUMBER_LIST[1]} list version incremented";
0.1 list version incremented

 

Has anyone else encountered this strange error, or have any idea how to resolve.

My pipeline repeatedly fails due to this.

Bitbucket_Pipelines_Failure.PNG

I'm using an Alpine 3.11 as my Docker image.

1 answer

1 accepted

0 votes
Answer accepted
Kareem Straker January 14, 2020

Fixed it with:

VERSION_NUMBER_LIST[1]=$((VERSION_NUMBER_LIST[1]+1)); echo "${VERSION_NUMBER_LIST[0]}.${VERSION_NUMBER_LIST[1]} list version incremented";
0.1 list version incremented

 ¯\_(ツ)_/¯ 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events