Missed Team ’24? Catch up on announcements here.

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

while loop failing without output

Jeremy J. Rossi September 24, 2020

Hello,

 

I'm trying to run the following pipeline code that is failing without an output. 

I've tried running it via CLI in a container and it works fine.

Can someone explain what's wrong?

- buildJobs=$(wc -l build-ids.txt | awk '{print $1}')
- inactiveJobs=0
-
while [ $inactiveJobs -lt $buildJobs ]; do inactiveJobs=$(aws codebuild batch-get-builds --ids $(cat build-ids.txt| tr '\n' ' ' | tr -d '"') | jq '.builds[]'.buildStatus | grep -c -v IN_PROGRESS); echo $inactiveJobs; sleep 10; done

 

Thanks 

1 answer

0 votes
b.gertz
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 18, 2021

I am in a similar boat where I have a while loop failing on a bash script that I know works locally. I get the error: bash: while: command not found. Is a while loop something that can be installed in the pipeline (if yes how?), or is it something purposefully not allowed?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events