Selaa lähdekoodia

Segregating configurations based on profile. Default is staging.

Chris Lim 9 vuotta sitten
vanhempi
sitoutus
11a48a7d1f
3 muutettua tiedostoa jossa 55 lisäystä ja 341 poistoa
  1. 24 100
      registration-dev.yml
  2. 0 137
      registration-staging.yml
  3. 31 104
      registration.yml

+ 24 - 100
registration-dev.yml

@@ -1,42 +1,4 @@
 spring:
-  profiles.active: common,dev
-  jpa:
-    properties:
-      jadira.usertype.autoRegisterUserTypes: true
-  http:
-    multipart:
-      maxFileSize: "25Mb"
-      maxRequestSize: "25Mb"
-storage:
-  file:
-    rootFolder: registration-dir
-security:
-  oauth2:
-    resource:
-      userInfoUri: http://localhost:8090/user
-
----
-spring:
-  profiles: common
-server:
-  undertow:
-    accesslog:
-      dir: target/logs
-      enabled: true
-      pattern: combined
-  compression:
-    enabled: true
-    min-response-size: 1
-  jackson:
-   # for further customization please consult the documentation:
-   # http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#howto-customize-the-jackson-objectmapper
-   # https://github.com/FasterXML/jackson-databind/wiki
-   # deserialization:
-   #   FAIL_ON_UNKNOWN_PROPERTIES: true
-   #   DEFAULT_VIEW_INCLUSION: true
----
-spring:
-  profiles: dev
   datasource:
     platform : postgres
     url: jdbc:postgresql://localhost:5432/crss_reg
@@ -70,68 +32,30 @@ spring:
   freemarker:
     enabled: false
     template-loader-path: classpath:/mail/templates
-server:
-  port: 8081
----
-#sample values. do not use yet
-spring:
-  profiles: prod
-  datasource:
-    platform : oracle
-    url: jdbc:oracle:thin:@//[HOST][:PORT]/SERVICE
-    username: foo
-    password: bar
-    driverClassName: oracle.jdbc.OracleDriver
-  jpa:
-    database: ORACLE
-    show-sql: true
 
----
-spring:
-  profiles: staging
-  datasource:
-    platform : oracle
-    url: jdbc:oracle:thin:@192.168.241.62:1521:ORCL
-    username: crss
-    password: crss
-    driverClassName: oracle.jdbc.OracleDriver
-    tomcat:
-      # Number of ms to wait before throwing an exception if no connection is available.
-      max-wait: 10000
-      # Maximum number of active connections that can be allocated from this pool at the same time.
-      max-active: 50
-      # Validate the connection before borrowing it from the pool.
-      test-on-borrow: true
-  jpa:
-    database: ORACLE
-    show-sql: true
-  mail:
-      host: smtp.gmail.com
-      port: 587
-      # TODO: replace this values
-      username: demo.exist.pemc@gmail.com
-      password: $pockTest
-      properties:
-        mail.smtp.auth: true
-        mail.smtp.starttlls.enable: true
-        mail.smtp.starttls.required: true
-  #we dont need spring mvc here
-  freemarker:
-    enabled: false
-    template-loader-path: classpath:/mail/templates
+security:
+  oauth2:
+    resource:
+      userInfoUri: http://localhost:8090/user
 
----
-spring:
-  profiles: devoracle
-  datasource:
-    platform : oracle
-    url: jdbc:oracle:thin:@localhost:1521/xe
-    username: pemccrss
-    password: secretpassword
-    driverClassName: oracle.jdbc.OracleDriver
-  jpa:
-    database: ORACLE
-    show-sql: true
-    hibernate:
-      ddl-auto: update
+server:
+  port: 8081
+  undertow:
+    accesslog:
+      dir: target/logs
+      enabled: true
+      pattern: combined
+  compression:
+    enabled: true
+    min-response-size: 1
+  jackson:
+   # for further customization please consult the documentation:
+   # http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#howto-customize-the-jackson-objectmapper
+   # https://github.com/FasterXML/jackson-databind/wiki
+   # deserialization:
+   #   FAIL_ON_UNKNOWN_PROPERTIES: true
+   #   DEFAULT_VIEW_INCLUSION: true
 
+storage:
+  file:
+    rootFolder: registration-dir

+ 0 - 137
registration-staging.yml

@@ -1,137 +0,0 @@
-spring:
-  profiles.active: common,dev
-  jpa:
-    properties:
-      jadira.usertype.autoRegisterUserTypes: true
-  http:
-    multipart:
-      maxFileSize: "25Mb"
-      maxRequestSize: "25Mb"
-storage:
-  file:
-    rootFolder: registration-dir
-security:
-  oauth2:
-    resource:
-      userInfoUri: http://localhost:8090/user
-
----
-spring:
-  profiles: common
-server:
-  undertow:
-    accesslog:
-      dir: target/logs
-      enabled: true
-      pattern: combined
-  compression:
-    enabled: true
-    min-response-size: 1
-  jackson:
-   # for further customization please consult the documentation:
-   # http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#howto-customize-the-jackson-objectmapper
-   # https://github.com/FasterXML/jackson-databind/wiki
-   # deserialization:
-   #   FAIL_ON_UNKNOWN_PROPERTIES: true
-   #   DEFAULT_VIEW_INCLUSION: true
----
-spring:
-  profiles: dev
-  datasource:
-    platform : postgres
-    url: jdbc:postgresql://localhost:5432/crss_reg
-    username: crss_reg
-    password: crss_reg
-    driverClassName: org.postgresql.Driver
-  jpa:
-    database: POSTGRESQL
-    show-sql: true
-    hibernate:
-      ddl-auto: update
-    properties:
-      jadira.usertype.autoRegisterUserTypes: true
-      javax.persistence.schema-generation.database.action: none
-      javax.persistence.schema-generation.create-source: metadata
-      javax.persistence.schema-generation.scripts.action: drop-and-create
-      javax.persistence.schema-generation.scripts.create-target: create.sql
-      javax.persistence.schema-generation.scripts.drop-target: drop.sql
-  mail:
-    host: smtp.gmail.com
-    port: 587
-    username: demo.exist.pemc@gmail.com
-    # please provide the password
-    password: $pockTest
-    properties:
-      mail.smtp.auth: true
-      mail.debug: true
-      mail.smtp.starttlls.enable: true
-      mail.smtp.starttls.required: true
-  #we dont need spring mvc here
-  freemarker:
-    enabled: false
-    template-loader-path: classpath:/mail/templates
-server:
-  port: 8081
----
-#sample values. do not use yet
-spring:
-  profiles: prod
-  datasource:
-    platform : oracle
-    url: jdbc:oracle:thin:@//[HOST][:PORT]/SERVICE
-    username: foo
-    password: bar
-    driverClassName: oracle.jdbc.OracleDriver
-  jpa:
-    database: ORACLE
-    show-sql: true
-
----
-spring:
-  profiles: staging
-  datasource:
-    platform : oracle
-    url: jdbc:oracle:thin:@192.168.241.62:1521:ORCL
-    username: crss
-    password: crss
-    driverClassName: oracle.jdbc.OracleDriver
-    tomcat:
-      # Number of ms to wait before throwing an exception if no connection is available.
-      max-wait: 10000
-      # Maximum number of active connections that can be allocated from this pool at the same time.
-      max-active: 50
-      # Validate the connection before borrowing it from the pool.
-      test-on-borrow: true
-  jpa:
-    database: ORACLE
-    show-sql: true
-  mail:
-      host: smtp.gmail.com
-      port: 587
-      # TODO: replace this values
-      username: demo.exist.pemc@gmail.com
-      password: $pockTest
-      properties:
-        mail.smtp.auth: true
-        mail.smtp.starttlls.enable: true
-        mail.smtp.starttls.required: true
-  #we dont need spring mvc here
-  freemarker:
-    enabled: false
-    template-loader-path: classpath:/mail/templates
-
----
-spring:
-  profiles: devoracle
-  datasource:
-    platform : oracle
-    url: jdbc:oracle:thin:@localhost:1521/xe
-    username: pemccrss
-    password: secretpassword
-    driverClassName: oracle.jdbc.OracleDriver
-  jpa:
-    database: ORACLE
-    show-sql: true
-    hibernate:
-      ddl-auto: update
-

+ 31 - 104
registration.yml

@@ -1,94 +1,4 @@
 spring:
-  profiles.active: common,dev
-  jpa:
-    properties:
-      jadira.usertype.autoRegisterUserTypes: true
-  http:
-    multipart:
-      maxFileSize: "25Mb"
-      maxRequestSize: "25Mb"
-storage:
-  file:
-    rootFolder: registration-dir
-security:
-  oauth2:
-    resource:
-      userInfoUri: http://localhost:8090/user
-
----
-spring:
-  profiles: common
-server:
-  undertow:
-    accesslog:
-      dir: target/logs
-      enabled: true
-      pattern: combined
-  compression:
-    enabled: true
-    min-response-size: 1
-  jackson:
-   # for further customization please consult the documentation:
-   # http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#howto-customize-the-jackson-objectmapper
-   # https://github.com/FasterXML/jackson-databind/wiki
-   # deserialization:
-   #   FAIL_ON_UNKNOWN_PROPERTIES: true
-   #   DEFAULT_VIEW_INCLUSION: true
----
-spring:
-  profiles: dev
-  datasource:
-    platform : postgres
-    url: jdbc:postgresql://localhost:5432/crss_reg
-    username: crss_reg
-    password: crss_reg
-    driverClassName: org.postgresql.Driver
-  jpa:
-    database: POSTGRESQL
-    show-sql: true
-    hibernate:
-      ddl-auto: update
-    properties:
-      jadira.usertype.autoRegisterUserTypes: true
-      javax.persistence.schema-generation.database.action: none
-      javax.persistence.schema-generation.create-source: metadata
-      javax.persistence.schema-generation.scripts.action: drop-and-create
-      javax.persistence.schema-generation.scripts.create-target: create.sql
-      javax.persistence.schema-generation.scripts.drop-target: drop.sql
-  mail:
-    host: smtp.gmail.com
-    port: 587
-    username: demo.exist.pemc@gmail.com
-    # please provide the password
-    password: $pockTest
-    properties:
-      mail.smtp.auth: true
-      mail.debug: true
-      mail.smtp.starttlls.enable: true
-      mail.smtp.starttls.required: true
-  #we dont need spring mvc here
-  freemarker:
-    enabled: false
-    template-loader-path: classpath:/mail/templates
-server:
-  port: 8081
----
-#sample values. do not use yet
-spring:
-  profiles: prod
-  datasource:
-    platform : oracle
-    url: jdbc:oracle:thin:@//[HOST][:PORT]/SERVICE
-    username: foo
-    password: bar
-    driverClassName: oracle.jdbc.OracleDriver
-  jpa:
-    database: ORACLE
-    show-sql: true
-
----
-spring:
-  profiles: staging
   datasource:
     platform : oracle
     url: jdbc:oracle:thin:@192.168.241.62:1521:ORCL
@@ -105,6 +15,13 @@ spring:
   jpa:
     database: ORACLE
     show-sql: true
+    properties:
+      jadira.usertype.autoRegisterUserTypes: true
+  http:
+    multipart:
+      maxFileSize: "25Mb"
+      maxRequestSize: "25Mb"
+
   mail:
       host: smtp.gmail.com
       port: 587
@@ -120,18 +37,28 @@ spring:
     enabled: false
     template-loader-path: classpath:/mail/templates
 
----
-spring:
-  profiles: devoracle
-  datasource:
-    platform : oracle
-    url: jdbc:oracle:thin:@localhost:1521/xe
-    username: pemccrss
-    password: secretpassword
-    driverClassName: oracle.jdbc.OracleDriver
-  jpa:
-    database: ORACLE
-    show-sql: true
-    hibernate:
-      ddl-auto: update
+security:
+  oauth2:
+    resource:
+      userInfoUri: http://localhost:8090/user
 
+server:
+  undertow:
+    accesslog:
+      dir: target/logs
+      enabled: true
+      pattern: combined
+  compression:
+    enabled: true
+    min-response-size: 1
+  jackson:
+   # for further customization please consult the documentation:
+   # http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#howto-customize-the-jackson-objectmapper
+   # https://github.com/FasterXML/jackson-databind/wiki
+   # deserialization:
+   #   FAIL_ON_UNKNOWN_PROPERTIES: true
+   #   DEFAULT_VIEW_INCLUSION: true
+
+storage:
+  file:
+    rootFolder: registration-dir