First of all my Jelastic provider has a great support so they helped a lot.
The first part is to deploy the application (or you might start with copying of your Postgres data. This gives you a neccessary information so that you can correct your application.properties before deploying your app)
- The support suggested to use their Maven plugin for build.
The link: maven-plugin-jelastic
- You should configure Application class so that you can create a deployable war.
The link: howto-create-a-deployable-war-file
- Pay attention that you have to disable embedded Tomcat of Spring Boot.
The spring-boot-starter-web dependency starts embedded Tomcat, so you can disable this by:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
- Then deploy your app by:
mvn jelastic:deploy
- If you have Angular web-client as I have, then you might have to correct base URL on which you access your server. You don't have a port, so you should add the context name if you set it during creating the environment on Jelastic.
For example if you name the context in Jelastic as "loc" then the baseURL will be:
angular.module('localizeApp')
.constant("baseURL", "/loc/")
.service('LocalizeData', ['$http', 'baseURL', function ($http, baseURL) {
this.getConfig = function () {
return $http.get(baseURL + "config");
};
The second part of deployment is to copy your Postgres local dump on Jelastic. It is pretty simple.
- Make a dump of your Postgres database using pgAdmin.
- Go to Jelastic Postgres web-console using the information given to you by Jelastic when you create the environment there.
- Create new database with the proper name. Create user with password.
- If your dump is not very big then go to SQL section in the web-console and choose Upload a file. Choose your dump file. Execute it. That's all.
- If you have a big database then you can upload the dump file via SCP (see ssh connection) and import via command line. The support recommended WinSCP, for example.
Then you should correct application.properties:
spring.datasource.url=jdbc:postgresql://your_jelastic_postgres_url/your_database
Also set the right user and password.