Git Product home page Git Product logo

heroku-deployment's Introduction

Deploying a Spring Boot app on Heroku using Git and Heroku CLI

Steps To Perform

Before you start deployment you need to have a Heroku account. Once you’re registered with Heroku, follow the steps below to deploy the Spring Boot app.

1. Download and install Heroku CLI

Heroku CLI is a command line application which allow you to create, deploy and manage Heroku apps.

2. Get Logged in to your Heroku account

Enter the following command to login to Heroku using Heroku CLI

Run the following commands in two separate terminals to create a blissful development experience where your browser auto-refreshes when files change on your hard drive.

heroku login

A message will be prompted to enter your Heroku account’s credentials.

Enter your Heroku credentials:
Email: [email protected]
Password: **************
Logged in as [email protected]

You’re logged in to Heroku.

3. Set up Git and generate a Heroku app

Execute the following commands from the root directory of the project to create a local Git repository for the project -

git init
git add .
git commit -m "initial commit"

Now, create a new heroku app using heroku command

heroku create

3. Voilà That's it!!

you can deploy the app by pushing the code to the repository which you just created.

git push heroku master

Heroku detects that the app and triggers the build accordingly.

##This way is not ideal in follwing cases,

Your project is closed source and you don’t want to push the source code to Heroku. Your project uses some dependencies that are internally developed for specific usage on premise only. In this case the source code won’t compile at Heroku because it won’t be able to download the internal dependencies.

Meanwhile you can also deploy executable jar/war of your project on Heroku by executing follownig commands with addition of above,

heroku plugins:install heroku-cli-deploy

heroku deploy:jar target/heroku-demo-0.0.1-SNAPSHOT.jar --app <APP-NAME>

heroku-deployment's People

Contributors

vrushofficial avatar

Stargazers

 avatar

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.