CI/CD OF CODE TO HEROKU USING CIRCLE CI

Continuous integration (CI) and continuous delivery (CD) are a set of principles that enable application development teams deliver code changes more frequently and reliably. The implementation is also known as the CI/CD pipeline.

Continuous integration is a coding practice that help development teams to implement small changes and check in code to version control repositories frequently.

Continuous delivery picks up where continuous integration ends. CD automates the delivery of applications to selected infrastructure environments. Most teams work with multiple environments other than the production, such as development and testing environments, and CD ensures there is an automated way to push code changes to them.

WHY CI/CD IS QUITE IMPORTANT

Continuous Integration (CI) allows you to continuously integrate code into a single shared and easy to access repository. CI/CD creates a fast and effective process of getting your product to market before your competition as well as releasing new features and bug fixes to keep your current customers happy.

These are just a few to mention amongst many advantages

HEROKU AND CIRCLE CI

Test before you deploy always

Heroku changed the way developers think about deployment. Being able to deploy with a simple git push Heroku master is an amazing thing. But setting up a proper continuous delivery workflow means automating every step of the process.

With CircleCI whenever you push a commit to master, it will go through a complete continuous delivery pipeline. All of your tests will run with our blazing fast parallelism, and only if they pass, your code will be pushed to Heroku automatically.

This is how these two relate, Incase you were wondering what business they had with each other.

HOW IT WORKS?

Glad you asked.

prerequisites

1 A circleci account.

2 An heroku account.

3 A github account.

Steps

1. Your created app should be on your Github , in your repository you’re going to create a new folder and call it “.circleci” inside this folder you’re going to create your “config.yml” file you’re config file is where your code which directs circle ci and what tasks to carry out on your code is going to be.

you could go to circle ci documentation , and there you’d find several configuration codes for whatever language you might be writing your app with and just copy and paste this code into your file.

version: 2.1
orbs:
heroku: circleci/heroku@0.0.10
workflows:
heroku_deploy:
jobs:
- heroku/deploy-via-git

2. Next we create our account on Heroku. After that you should be directed to a dashboard where you can create a new app then just do that.

Next, go to where you have your profile picture and click, you should see account settings, click on account settings and scroll down to where you see the API key and copy that, you’ll be needing it for the next step.

3. We create our account on CircleCi, you have the option to create your account with github, once you do this you should be able to see your GitHub repositories on CircleCi once you’re logged in.

4. Finally you can make changes to your code and push to your Github, automatically CircleCi will automate your deployment to Heroku. And there you have it, safe to call it magic ;)

inspired by my mentor MMADU MANASSAH

--

--

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