Pipelines fail on sleep Edited

I am creating instance on digitalocan and then pulling waiting while it will be finalized. 

When it comes to "sleep" line, pipeline buld fails. I am using php:7.1.1 image

it works well for me locally.

My script for the pipeline looks like this:

#figure out droplet IP
locked=true
count=0
while [ $locked == true -a $count -lt 50 ]
do
rspns=$(curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $DIGITAL_OCEAN_TOKEN" "https://api.digitalocean.com/v2/droplets/$DROPLET_ID" )
locked=$(echo $rspns | jq .droplet.locked)
echo "DROPLET $DROPLET_ID creation is IN PROGGRESS"
sleep 4

(( count++ ))
done

[ $locked == true ] && errcho "Unable to load droplet details"


Pipeline output:

+ umask 000

+ git clone -n https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/repo.git $BUILD_DIR ; git checkout f9ffa6d1c809df1b1f762b1081005213b7667642 ; git remote set-url origin git@bitbucket.org:repo.git
Cloning into '/opt/atlassian/pipelines/agent/build'...
Note: checking out 'f9ffa6d1c809df1b1f762b1081005213b7667642'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b <new-branch-name>

HEAD is now at f9ffa6d... ppl

+ chmod 777 $BUILD_DIR

+ export DEPLOYING_ENV='STAGING'

+ alias errcho='>&2 echo'

+ apt-get update && apt-get -q -y install jq rsync
Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB]
Get:2 http://security.debian.org jessie/updates/main amd64 Packages [561 kB]
Ign http://deb.debian.org jessie InRelease
Get:3 http://deb.debian.org jessie-updates InRelease [145 kB]
Get:4 http://deb.debian.org jessie Release.gpg [2373 B]
Get:5 http://deb.debian.org jessie Release [148 kB]
Get:6 http://deb.debian.org jessie-updates/main amd64 Packages [17.8 kB]
Get:7 http://deb.debian.org jessie/main amd64 Packages [9063 kB]
Fetched 10.0 MB in 3s (2544 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
libpopt0
Suggested packages:
openssh-client openssh-server
The following NEW packages will be installed:
jq libpopt0 rsync
0 upgraded, 3 newly installed, 0 to remove and 37 not upgraded.
Need to get 541 kB of archives.
After this operation, 1166 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian/ jessie/main libpopt0 amd64 1.16-10 [49.2 kB]
Get:2 http://deb.debian.org/debian/ jessie/main jq amd64 1.4-2.1+deb8u1 [102 kB]
Get:3 http://deb.debian.org/debian/ jessie/main rsync amd64 3.1.1-3 [390 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 541 kB in 0s (980 kB/s)
Selecting previously unselected package libpopt0:amd64.
(Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 12250 files and directories currently installed.)
Preparing to unpack .../libpopt0_1.16-10_amd64.deb ...
Unpacking libpopt0:amd64 (1.16-10) ...
Selecting previously unselected package jq.
Preparing to unpack .../jq_1.4-2.1+deb8u1_amd64.deb ...
Unpacking jq (1.4-2.1+deb8u1) ...
Selecting previously unselected package rsync.
Preparing to unpack .../rsync_3.1.1-3_amd64.deb ...
Unpacking rsync (3.1.1-3) ...
Processing triggers for systemd (215-17+deb8u6) ...
Setting up libpopt0:amd64 (1.16-10) ...
Setting up jq (1.4-2.1+deb8u1) ...
Setting up rsync (3.1.1-3) ...
invoke-rc.d: policy-rc.d denied execution of restart.
Processing triggers for libc-bin (2.19-18+deb8u7) ...
Processing triggers for systemd (215-17+deb8u6) ...

+ source .deploytools/pipelines/00_set-environment-based-variables.sh

+ source .deploytools/pipelines/01_set-deployment-private-key.sh

+ source .deploytools/pipelines/02_create-droplet.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 61 1552 53 688 100 266 647 250 0:00:01 0:00:01 --:--:-- 647 100 1552 100 1286 100 266 1210 250 0:00:01 0:00:01 --:--:-- 1210
Droplet created: 60756683
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 656 0 656 0 0 1540 0 --:--:-- --:--:-- --:--:-- 1539 100 1247 0 1247 0 0 2926 0 --:--:-- --:--:-- --:--:-- 2927
DROPLET 60756683 creation is IN PROGGRESS

 

0 answers

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Agile

How Davin Studer gets Confluence to do everything he wants it to do...except dishes

  @Davin Studer holds many interests, including but not limited to health tech and Star Trek. Read on to discover more about Davin, from his favorite Confluence macros to his favorite lit...

201 views 1 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you