Skip to main content

Kotlin + Spring + Vue: Deploy to Heroku with Gradle

Let's talk about CI/CD.
This article is the direct continuation of this topic - Kotlin + Spring + Vue: CI/CD after this step - Kotlin + Spring + Vue: Migration from Maven to Gradle. Here we review what is required to be changed after migration to Gradle for successful Heroku deployment.

Procfile 

Of course, our Procfile have to be changed. We should provide the instructions to Heroku what exactly is needed to run:

web: java -Dserver.port=$PORT -jar backend/build/libs/backend-0.0.1-SNAPSHOT.jar


Environment Variables

Heroku is able to determine the kind of application (Spring Boot, for example) and execute the relevant building instructions. But our root project is not a Spring Boot application. If we leave everything as is, Heroku asks us to define stage task, but that's not an easy way.
It's better to specify GRADLE_TASK variable with value build (your application -> Settings -> Reveal Config Vars):

reCAPTCHA

And now one thing left: we have to update our reCAPTCHA site, if we use a new domain for our application. You can find the instruction here: Kotlin + Spring + Vue: Spam Protection (reCAPTCHA). If you already did that, so just:
  • Create new reCAPTCHA for the new domain
  • Update Heroku environment variables: GOOGLE_RECAPTCHA_KEY_SITE and GOOGLE_RECAPTCHA_KEY_SECRET
  • Update Key Site in your frontend subproject

Links

Comments

Popular posts from this blog

Make Authentication More Secure With Cookies Email Registration Confirmation That's all for this year. See you in 2020!

Kotlin + Spring Boot + Vue.js: + Gradle

Hello, dear visitors! I added two new articles to the Fullstack section: Kotlin + Spring + Vue: Migration from Maven to Gradle Kotlin + Spring + Vue: Deploy to Heroku with Gradle I'll be glad if you will find then useful for yourself.

Kotlin + Spring Boot + Vue.js

Hello there! I've published my first set of articles about developing web applications using Kotlin , Spring Boot and Vue.js : Koltin + Spring Boot + Vue.js Here are the contents of this set: Introduction Start CI/CD REST API Database Connection Authentication Spam Protection (reCAPTCHA) Email