Code Monkey home page Code Monkey logo

elabdeployment's Introduction

Build Status

This is the source code for the blog post

https://exampledriven.wordpress.com/2016/11/04/spring-boot-heroku-example/

Deploy using git

#Download an empty spring boot application
curl https://start.spring.io/starter.tgz -d style=web -d style=actuator -d name=heroku-example | tar -xzvf -

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

heroku create
git push heroku master

Prerequisites for deploying without git

heroku login
#This step is only required if the applications are not yet created
heroku create <WEB SERVICE NAME> --no-remote
heroku create <WORKER SERVICE NAME> --no-remote

heroku config:set WORKER_HOST=<WORKER SERVICE NAME>.herokuapp.com

Deploy using heroku CLI deploy

heroku plugins:install heroku-cli-deploy
mvn clean install
cd web-service
heroku deploy:jar target/web-service-0.0.1-SNAPSHOT.jar --app <WEB SERVICE NAME>
cd ../worker-service
heroku deploy:jar target/worker-service-0.0.1-SNAPSHOT.jar --app <WORKER SERVICE NAME>

Deploy using maven without installing heroku CLI

The application name is written into the pom.xml, it should be updated to match the application names created above In this example the heroku plugin is moved to a build profile called heroku that can be activated using

mvn clean install -Pheroku

The non profile version would work like this

cd web-service
HEROKU_API_KEY="xxx-xxx-xxxx" mvn heroku:deploy
cd ../worker-service
HEROKU_API_KEY="xxx-xxx-xxxx" mvn heroku:deploy

Deploy using maven with installing heroku CLI

cd web-service
mvn heroku:deploy
cd ../worker-service
mvn heroku:deploy

Checking logs

heroku logs --tail --app <WEB SERVICE NAME>
heroku logs --tail --app <WORKER SERVICE NAME>

Resources:

elabdeployment's People

Watchers

Dan Montgomery avatar James Cloos avatar Tarandeep Dhupar avatar  avatar  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.