Skip to content

Commit 19b58eb

Browse files
authored
Merge pull request #4 from manirDev/aws-deploy
AWS deployement and application properties profiles
2 parents b4ba2e2 + e90e55c commit 19b58eb

File tree

7 files changed

+61
-8
lines changed

7 files changed

+61
-8
lines changed

src/main/java/com/springboot/blog/rest/api/SpringbootBlogRestApiApplication.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
package com.springboot.blog.rest.api;
22

3+
import com.springboot.blog.rest.api.entity.Role;
4+
import com.springboot.blog.rest.api.repository.RoleRepository;
35
import org.modelmapper.ModelMapper;
6+
import org.springframework.beans.factory.annotation.Autowired;
7+
import org.springframework.boot.CommandLineRunner;
48
import org.springframework.boot.SpringApplication;
59
import org.springframework.boot.autoconfigure.SpringBootApplication;
610
import org.springframework.context.annotation.Bean;
711

812
@SpringBootApplication
9-
public class SpringbootBlogRestApiApplication {
13+
public class SpringbootBlogRestApiApplication implements CommandLineRunner {
1014

1115
@Bean
1216
public ModelMapper modelMapper(){
@@ -17,4 +21,17 @@ public static void main(String[] args) {
1721
SpringApplication.run(SpringbootBlogRestApiApplication.class, args);
1822
}
1923

24+
@Autowired
25+
private RoleRepository roleRepository;
26+
@Override
27+
public void run(String... args) throws Exception {
28+
//admin role
29+
Role adminRole = new Role();
30+
adminRole.setName("ROLE_ADMIN");
31+
roleRepository.save(adminRole);
32+
//user role
33+
Role userRole = new Role();
34+
userRole.setName("ROLE_USER");
35+
roleRepository.save(userRole);
36+
}
2037
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
3+
spring.jpa.show-sql =true
4+
spring.jpa.properties.hibernate.format_sql= true
5+
#manirdev@235
6+
spring.datasource.password=Password123#@!
7+
spring.datasource.username=root
8+
spring.datasource.url=jdbc:mysql://localhost:3306/devDB?serverTimezone=UTC
9+
spring.jpa.hibernate.ddl-auto=update
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
3+
spring.jpa.show-sql =true
4+
spring.jpa.properties.hibernate.format_sql= true
5+
#manirdev@235
6+
spring.datasource.password=root$123
7+
spring.datasource.username=root
8+
spring.datasource.url=jdbc:mysql://manirdev.cjvift6niayo.us-east-1.rds.amazonaws.com:3306/springbootBlogRestApi?serverTimezone=UTC
9+
spring.jpa.hibernate.ddl-auto=update
10+
11+
#elastic build service port:
12+
server.port=5000
13+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
3+
spring.jpa.show-sql =true
4+
spring.jpa.properties.hibernate.format_sql= true
5+
#manirdev@235
6+
spring.datasource.password=Password123#@!
7+
spring.datasource.username=root
8+
spring.datasource.url=jdbc:mysql://localhost:3306/springbootBlogRestApi?serverTimezone=UTC
9+
spring.jpa.hibernate.ddl-auto=update
10+
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

2-
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
3-
spring.jpa.show-sql =true
4-
spring.jpa.properties.hibernate.format_sql= true
5-
spring.datasource.password=manirdev@235
6-
spring.datasource.username=root
7-
spring.datasource.url=jdbc:mysql://localhost:3306/springbootBlogRestApi?serverTimezone=UTC
8-
spring.jpa.hibernate.ddl-auto=update
2+
#spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
3+
#spring.jpa.show-sql =true
4+
#spring.jpa.properties.hibernate.format_sql= true
5+
#spring.datasource.password=manirdev@235
6+
#spring.datasource.username=root
7+
#spring.datasource.url=jdbc:mysql://localhost:3306/springbootBlogRestApi?serverTimezone=UTC
8+
#spring.jpa.hibernate.ddl-auto=update
99

1010
logging.level.org.springframework.security=DEBUG
1111

@@ -16,3 +16,7 @@ app.jwt-expiration-milliseconds = 604800000
1616
#Swagger enabling
1717
spring.mvc.pathmatch.matching-strategy = ANT_PATH_MATCHER
1818

19+
#Changing application properties to other deploy env
20+
#this will activate prod,dev or qa properties file
21+
spring.profiles.active=prod
22+

src/main/resources/data.sql

Whitespace-only changes.

src/main/resources/schema.sql

Whitespace-only changes.

0 commit comments

Comments
 (0)