Giter Club home page Giter Club logo

circle-demo's Introduction

CircleCI demo with Heroku deployments

This project meant to explain in an easy way how to:

  • Make a dockerized CI/CD pipeline with circle CI
  • Deploy the application to Heroku using Github as VCS

Why Dockerized?

  • Solves the "work on my machine" issue, guaranteeing that every environment is the same, ie, dev and prod environment will use the same flavor of java in the same OS.
  • Allows deploying in any platform from bare metal to the cloud with minimum configuration.

What do you need?

  • A Github account
  • Open a Circle CI account associated to the Github account created in the first step
  • Open a Heroku account, also install the Heroku CLI for your computer.
  • The code to deploy, for this example we are using a simple spring boot application generated by start.spring.io

Steps:

  1. In the root of your project create a folder named .circleci
  2. In the .circleci folder add the configuration file config.yml for your pipeline you can check the example made for this project here
  3. Just push the code and review the pipeline in your CircleCI dashboard ๐Ÿ˜ƒ

Things to have in mind

  • CircleCI Workflow has a different environment to each step if you want that the info of one step available for other, you need to use the workspace feature
  • To be able to deploy to Heroku you need to define the project environment variables HEROKU_APP_NAME and HEROKU_API_KEY. you can achieve this with environment variable feature, Is a safe way to store sensitive information to be used during the pipeline execution
  • To obtain the HEROKU_API_KEY value you need to execute locally heroku auth:token
  • Heroku uses the port 80 to expose the app, if the app is deployed using docker you must add a line in the application.properties file, the spring configuration will set as default the port 8080 if the $PORT environment variable isn't defined
  • We use 2 docker images
    • Dockerfile: run the Compile and Test steps.
    • Dockerfile.runtime: A multistage Dockerfile that is responsible for the Package and Deploy steps.

Reference Documentation

For further reference, please consider the following sections:

Heroku

CircleCI

circle-demo's People

Contributors

prodriguezval avatar

Watchers

James Cloos avatar

Forkers

felipet1987

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.