From ccf5ce2d6c88b336566cbc487d8842acc59c597c Mon Sep 17 00:00:00 2001 From: slem1 Date: Tue, 24 Oct 2017 13:52:17 +0200 Subject: [PATCH] How to switch datasource url - spring profile part --- .../src/test/resources/application-ci.properties | 1 + .../src/test/resources/application-local.properties | 1 + .../src/test/resources/application.properties | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 spring-boot-test-howto-business/src/test/resources/application-ci.properties create mode 100644 spring-boot-test-howto-business/src/test/resources/application-local.properties diff --git a/spring-boot-test-howto-business/src/test/resources/application-ci.properties b/spring-boot-test-howto-business/src/test/resources/application-ci.properties new file mode 100644 index 0000000..e511fe5 --- /dev/null +++ b/spring-boot-test-howto-business/src/test/resources/application-ci.properties @@ -0,0 +1 @@ +spring.datasource.url=jdbc:postgresql://[MY_SERVER_IP]:5432/testhowto \ No newline at end of file diff --git a/spring-boot-test-howto-business/src/test/resources/application-local.properties b/spring-boot-test-howto-business/src/test/resources/application-local.properties new file mode 100644 index 0000000..c1cd652 --- /dev/null +++ b/spring-boot-test-howto-business/src/test/resources/application-local.properties @@ -0,0 +1 @@ +spring.datasource.url=jdbc:postgresql://localhost:5432/testhowto \ No newline at end of file diff --git a/spring-boot-test-howto-business/src/test/resources/application.properties b/spring-boot-test-howto-business/src/test/resources/application.properties index 0dd48b2..81aaefb 100644 --- a/spring-boot-test-howto-business/src/test/resources/application.properties +++ b/spring-boot-test-howto-business/src/test/resources/application.properties @@ -1,4 +1,5 @@ -spring.datasource.url=jdbc:postgresql://localhost:5432/testhowto +spring.profiles.active=@spring.profiles.active@ +#spring.datasource.url=jdbc:postgresql://localhost:5432/testhowto spring.datasource.username=testhowto spring.datasource.password=testhowto spring.datasource.driver-class-name=org.postgresql.Driver \ No newline at end of file