Skip to content

Commit

Permalink
configured environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Toyin96 committed Jun 11, 2021
1 parent 10d6fb3 commit 5243079
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ build/

### VS Code ###
.vscode/
/src/main/resources/application-dev.properties
6 changes: 5 additions & 1 deletion src/main/resources/application-dev.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ spring.datasource.password=m18job,,
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

# we need to add this code to create table for us when we run our program/test
spring.jpa.hibernate.ddl-auto=create
spring.jpa.hibernate.ddl-auto=update

CLOUD_NAME=debugged-enterprise
API_KEY=162197259762483
API_SECRET=lFCgQ5AC-_66zxhOExLFhdx-6HE
12 changes: 8 additions & 4 deletions src/main/resources/application-prod.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
postgres://xelghhnfhigush:a027b8023b634510a6d2f889a3c534e42fb7e717d59dcfb16facf363e16cdd07@ec2-52-86-2-228.compute-1.amazonaws.com:5432/d8qoi43hc3fqp1

spring.datasource.url=jdbc:postgresql://ec2-52-86-2-228.compute-1.amazonaws.com:5432/d8qoi43hc3fqp1
spring.datasource.username=xelghhnfhigush
spring.datasource.password=a027b8023b634510a6d2f889a3c534e42fb7e717d59dcfb16facf363e16cdd07
spring.datasource.url=${DB_URL}
spring.datasource.username=${DB_USER}}
spring.datasource.password=${DB_PASSWORD}
spring.datasource.driver-class-name=org.postgresql.Driver

# we need to add this code to create table for us when we run our program/test
spring.jpa.hibernate.ddl-auto=update
spring.jpa.hibernate.ddl-auto=update

CLOUD_NAME=${CLOUD_NAME}
API_KEY=${API_KEY}
API_SECRET=${API_SECRET}
6 changes: 1 addition & 5 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
spring.profiles.active=dev

CLOUD_NAME=debugged-enterprise
API_KEY=162197259762483
API_SECRET=lFCgQ5AC-_66zxhOExLFhdx-6HE
spring.profiles.active=${PROFILE:dev}
2 changes: 1 addition & 1 deletion src/test/java/com/blogapp/BlogAppApplicationTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class BlogAppApplicationTests {
DataSource datasource;

@Test
void applicationCanConnectToDatabaseTest(){
void applicationCanConnectToLocalDatabaseTest(){
assertThat(datasource).isNotNull();
log.info("Datasource object is created");

Expand Down

0 comments on commit 5243079

Please sign in to comment.