I was working on a simple application in Spring Boot. It was developed locally (and it works) with:
- Gradle,
- H2 database with connection properties set in
application.propertiesplaced on project's root - Maven folders structure (
src/main/groovy,src/main/resources, etc.)
Now it's the time when I'd like to deploy it to the Openshift, so I need to create an additional, production configuration with a MySQL settings, but I don't know where to put it and how to use it.
So my questions are:
- What should I do to have two different configurations (
developmentandproduction)? - Where to put the configuration files?
- Do I have to change something in the
build.gradle? - How to build the app with a development or production config?
- How to run the app with a development or production config?
- What are the best practices for creating multiple environment configurations?
I'm rather a frontend dev and all these backend stuff are not obvious for me, so please consider it in your answers.
This is the content of my current build.gradle
plugins {
id 'org.springframework.boot' version '1.5.3.RELEASE'
id 'java'
id 'groovy'
}
jar {
baseName = 'myproject'
version = '0.0.1-SNAPSHOT'
}
repositories {
jcenter()
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
testCompile("org.springframework.boot:spring-boot-starter-test")
compile("org.springframework.boot:spring-boot-starter-data-jpa")
compile 'mysql:mysql-connector-java'
compile("com.h2database:h2")
compile("org.springframework.boot:spring-boot-starter-security")
compile('io.jsonwebtoken:jjwt:0.7.0')
compile localGroovy()
}