This post will walk you through how to setup a & (CI/CD) pipeline with , & easily. In the end of this tutorial, you should be able to setup your own as shown in the diagram above. Continuous Integration Continuous Deployment CircleCI Docker Heroku CI/CD This tutorial assumes that you have: A Account — for free. Heroku sign up A installed. Heroku CLI A Account — for free with your Github account. CircleCI sign up version 3.5 installed locally. Python The source code of the application used in this demo is available on my . Github 1 — Heroku First, login in using the email address & password you used when creating your account: Heroku heroku login To clone the sample application so that you have a local version of the code that you can then deploy to , execute the following commands in your local command shell or terminal Heroku git clone cd circleci-heroku-flask/ https://github.com/mlabouardy/circleci-heroku-flask.git Note: in case you are using your own app, you should add the following files to your code repository: : It tells what commands should be run Procfile Heroku : In this file you will list the packages/dependencies that should install for you requirements.txt pip Create an app on , which prepares to receive your source code: Heroku Heroku heroku create movies-store-demo Provision a database add-on: MySQL heroku addons:add cleardb:ignite — app movies-store-demo will automatically add a config var with the database credentials in the form of a URL. You find the config vars under the Settings tab, and click the button to “ ” Heroku Reveal config vars Now deploy the application: git remote add heroku https://git.heroku.com/movies-store-demo.git Go to , click on “ ” button: Heroku Dashboard Open App You should see: Note: As a handy shortcut, you can open the application as follows: heroku open 2 — CircleCI The following sections walk through how steps are configured for this application, how to run unit tests, build & push the to , and how to deploy the demo application to : CI/CD Docker Image DockerHub Heroku The contains steps: .circleci/config.yml CI/CD We use as the primary container & for the build environment. Python 3.5 MySQL To speed up the builds, we places the Python into the CircleCi cache and restores cache before running virtualenv pip install. requires database therefore we need to wait for the container to be ready. Unit Tests MySQL We install the , build the from the stored in the repository, and then Push the image to . Docker Client docker image Dockerfile Github DockerHub Finally, we install & push the changes to Heroku CLI Heroku. As shown in the configuration file above, we will need to set some , so navigate to the Project settings: environment variables Finally, to enable the connection to the from we need to create an SSH Key without passphrase. Issue the following command: Heroku Git Server CircleCI ssh-keygen -t rsa Then, add the private key ithe CircleCI UI SSH Permissions page with a hostname of as follows: git.heroku.com The public key is added to Heroku on the page: Account Now every time you push changes to your repo, will automatically deploy the changes to . Here’s a passing build: Github CircleCI Heroku The steps as described in file: CI/CD pipeline config.yml The repository on : Docker Image DockerHub last build from : Heroku CircleCI For more articles check my ❤ blog