The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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?

TAGS
AUG Leaders

Atlassian Community Events