Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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
TAGS
Community showcase
Published in Bitbucket Pipelines

Bitbucket Pipelines Runners is now in open beta

We are excited to announce the open beta program for self-hosted runners. Bitbucket Pipelines Runners is available to everyone. Please try it and let us know your feedback. If you have any issue...

817 views 15 10
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you