Bitbucket Pipelines to Heroku

Pipeline Vectors by Vecteezy

Hi everyone! With me again to share some experience, though or opinion about technology related with software engineering field. Today, I will share about my experience did Bitbucket Pipelines and deploying to Heroku.

Maybe this article would be the shortest article among the others. Because it’s very simple, but we have this problem in the past!

So, what’s the problem? We have been facing the situation that should use Heroku for our development server. We know for deploying application to Heroku, we should have a remote url to Heroku git itself. It would be no issue when we just do it without have our own repository.

But, on some project, we have multiple team members that did development on same repository. So, ideally the code between our repository and Heroku repository should be always sync. We can solve this issue by push our code twice, first on our repository then Heroku repository or vice versa.

Picture 1 Our code push flow

But sometimes we forgot do this and made some confused between team members. And finally, we have solution for this. Since we use Bitbucket for our repository, we can use Bitbucket Pipelines for solving this issue. The idea is we just push it into our repository, and Bitbucket Pipelines will be push our code to Heroku.

Picture 2 Our new code push flow

For achieve this solution, we should enable Bitbucket Pipelines on our Bitbucket repository. Then, bitbucket-pipelines.yml should be created on your root project.

This is the example of our deployment code to Heroku for PHP & Golang code:

Very simple right? And, what’s $HEROKU_API_KEY and $HEROKU_APP_NAME means? It is a variables that you can configured it on repository variables setting. If you want to made it secret, this option would be nice for you. And you need more security for the value, you could made it Secured by checked the Secured checklist when adding the variables.

Picture 3 Repository variables on Bitbucket

Hope you enjoy it, I’m happy if this article useful for you! Happy automated delivery!

Thank you!




Software Engineer | Traveler | Guitarist | J-Lovers

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Functional data validation in Swift

Video Conferencing Software for Small Business

Why I built a Serverless Web Crawler

Mastering the World of Android Testing (Part 1)

PAE Paging - Memory mapping on x86

Create image , Swap parts of two images , Make a Collage with Python CV2

Fix default Redshift cluster settings for better database performance

Security Configurations With Kakfa Connect and ElasticSearch

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Bismo Baruno

Bismo Baruno

Software Engineer | Traveler | Guitarist | J-Lovers

More from Medium

Securing credentials in Fluentd configurations

What is Infrastructure as Code and How Can You Leverage It?

Ship First Development

The Client for our app