From 64e776ed78c6b4e4ef8c26527bfa3fe7672b2e22 Mon Sep 17 00:00:00 2001 From: Bossanyi Tibor Date: Wed, 6 May 2020 21:43:24 +0200 Subject: [PATCH] spring.profiles.active dev, deploy --- .gitlab-ci.yml | 2 +- gradlew.bat | 1 + src/main/resources/application-deploy.properties | 13 +++++++++++++ src/main/resources/application-dev.properties | 13 +++++++++++++ src/main/resources/application.properties | 1 + 5 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/application-deploy.properties create mode 100644 src/main/resources/application-dev.properties diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 17c6a84..70c616c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,7 +29,7 @@ build: test: stage: test script: - - ./gradlew check + - ./gradlew check --args='--spring.profiles.active=deploy' deploy: stage: deploy diff --git a/gradlew.bat b/gradlew.bat index 62bd9b9..85ded3c 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -85,6 +85,7 @@ set CMD_LINE_ARGS=%* set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle +echo JAVA_OPTS: %JAVA_OPTS% "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% :end diff --git a/src/main/resources/application-deploy.properties b/src/main/resources/application-deploy.properties new file mode 100644 index 0000000..0f0152b --- /dev/null +++ b/src/main/resources/application-deploy.properties @@ -0,0 +1,13 @@ +spring.profiles.active=deploy +## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties) +#spring.datasource.url = jdbc:mysql://localhost:3306/aitrainer?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useSSL=false +spring.datasource.url = jdbc:mysql://172.19.0.2:3306/aitrainer?serverTimezone=CET&useSSL=false&characterEncoding=UTF-8&allowMultiQueries=true +spring.datasource.username = aitrainer +spring.datasource.password = andio2009 + + +## Hibernate Properties + + +# The SQL dialect makes Hibernate generate better SQL for the chosen database +spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect \ No newline at end of file diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties new file mode 100644 index 0000000..2097769 --- /dev/null +++ b/src/main/resources/application-dev.properties @@ -0,0 +1,13 @@ +spring.profiles.active=dev +## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties) +#spring.datasource.url = jdbc:mysql://localhost:3306/aitrainer?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useSSL=false +spring.datasource.url = jdbc:mysql://localhost:3306/aitrainer?serverTimezone=CET&useSSL=false&characterEncoding=UTF-8&allowMultiQueries=true +spring.datasource.username = aitrainer +spring.datasource.password = andio2009 + + +## Hibernate Properties + + +# The SQL dialect makes Hibernate generate better SQL for the chosen database +spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 40fb793..7de7b16 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,3 +1,4 @@ +spring.profiles.active=dev,deploy ## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties) #spring.datasource.url = jdbc:mysql://localhost:3306/aitrainer?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useSSL=false spring.datasource.url = jdbc:mysql://localhost:3306/aitrainer?serverTimezone=CET&useSSL=false&characterEncoding=UTF-8&allowMultiQueries=true