How I can get data from pipeline results Edited

Roman O I'm New Here Nov 13, 2017

Hello. Example I have step in my bitbucket-pipelines.yml

- step:
name: Deploy to remote server
image: atlassian/default-image:latest
caches:
- build
script:
- echo "Deploy [develop] branch."
- cd build/
- echo "Sync remote server with build dir"
- rsync -avz --delete -e 'ssh -p '"$PUBLIC_PORT"'' --log-file=deploy-$BITBUCKET_BRANCH-$BITBUCKET_COMMIT.log ./ $SERVER_USERNAME@$IP_ADDRESS:$DEVELOPMENT_BUILD_PATH
- echo "Copy log file to remote server"
- scp -P $PUBLIC_PORT -rp deploy-$BITBUCKET_BRANCH-$BITBUCKET_COMMIT.log $SERVER_USERNAME@$IP_ADDRESS:$DEVELOPMENT_BUILD_PATH
- echo "Restart Remote Nginx Server"
- ssh $SERVER_USERNAME@$IP_ADDRESS -p $PUBLIC_PORT "sudo service nginx restart"
- curl -s -X POST https://api.telegram.org/bot$TELEGRAM_BOT_API_KEY/sendMessage -d chat_id=@webqual -d text="<b>[Deploy] Code successfully deployed on server</b><br>Commit <b>$BITBUCKET_COMMIT</b> from <b>$BITBUCKET_BRANCH</b> branch successfully deployed on server." -d parse_mode=HTML

 I want send with curl additional data from pipeline results. Example: get time from last or previouse step. 

Screenshot_20171113_184036.png

What I want send with curl (example):

Commit #sd7as5 successfully deployed on server.

Timeline: 

    -> Prepare step took 7s

    -> Install dependenies step took 2m 23s ... and more

1 answer

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

663 views 0 4
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot