#########################
# Global settings
# These settings are common across all profile.
# They can be over-ridden by individual profiles.
# Profiles cannot be inherited/extended.
# Profiles are separated by a line having ---
#########################

marvel:
  env:
    name: "No name set"
    description: "No description set"
  scheduling:
    enabled: false

spring:
  profiles:
    active: "local-mem" # default profile
    #active: "marvel-test" # default profile
  jpa:
    # The following may not be needed - but just in case, uncomment it for enabling lazy loading
    #open-in-view: false
    properties:
      hibernate:
        ddl-auto: "none" # Hibernate should not create schema elements on demand. We use flyway for explicit DDL.
        default_schema: "public"
        format_sql: "true"
        generate_statistics: "true"
        order_inserts: "true"
        jdbc:
          batch_size: 1000
  flyway:
    enabled: true
  aop:
    auto: true

elasticsearch: # default values for all profiles
  production:
    host: "search-sim-metrics-v6-rhfhvb54pmawksutaybix43i6q.us-west-1.es.amazonaws.com"
    port: 443
    protocol: "https"
    cluster: "069289935426:sim-metrics-v6"
  test:
    host: "localhost"
    port: 9200
    protocol: "https"
    cluster: "[docker cluster]"

jira:
  url: "https://jira.zooxlabs.com"
  pingIssueKey: "MRVL-782"

vault:
  uri: "http://localhost:8200"
  token: "00000000-0000-0000-0000-000000000000"

---
marvel:
  env:
    name: "Local Dev Environment with in-memory DB"
    description: "For running the REST API locally, on a local in-memory DB that's completely managed by Flyway"

server:
  port: 8080

spring:
  profiles: "local-mem"
  h2:
    console:
      enabled: true
      path: "/h2" # H2 console with an editor to run SQL is available at http://localhost:8080/h2
  datasource:
    url: "jdbc:h2:mem:marvel_mem;DB_CLOSE_DELAY=-1"
    username: "marvel_mem"
    password: "marvel_mem"
    driver-class-name: "org.h2.Driver"
  flyway:
    locations: "classpath:db/migration/pre_base_line/common,classpath:db/migration/pre_base_line/h2"

elasticsearch:
  #production: # over-ride this for development
    #host: "localhost"
    #port: 9200
    #cluster: "069289935426:sim-metrics-v6"
---
marvel:
  env:
    name: "Local Dev Environment with Docker Postgres"
    description: "For running the REST API locally, on a local Postgres DB that's completely managed by Flyway"

server:
  port: 8080

spring:
  profiles: "local-docker"
  datasource:
    url: "jdbc:postgresql://postgres:5432/marvel_dev"
    username: "postgres"
    driver-class-name: "org.postgresql.Driver"
  flyway:
    locations: "classpath:db/migration/pre_base_line/common,classpath:db/migration/pre_base_line/postgres"
  jpa:
    properties:
      hibernate:
        dialect: "org.hibernate.dialect.PostgreSQLDialect"

vault:
  uri: "http://vault:8200"

---
marvel:
  env:
    name: "Local Dev Environment with Persistence"
    description: "For running the REST API locally, on a local Postgres DB that's completely managed by Flyway"

server:
  port: 8080

spring:
  profiles: "local-dev"
  datasource:
    url: "jdbc:postgresql://localhost:5432/marvel_dev"
    username: "marvel_dev"
    password: "marvel_dev"
    driver-class-name: "org.postgresql.Driver"
  flyway:
    locations: "classpath:db/migration/pre_base_line/common,classpath:db/migration/pre_base_line/postgres"
  jpa:
    properties:
      hibernate:
        dialect: "org.hibernate.dialect.PostgreSQLDialect"

---
marvel:
  env:
    name: "Local Dev Integration with Persistence in baselined DB"
    description: "For running the REST API locally, on a local Postgres DB that's baselined from existing DB, with later migrations managed by Flyway"

spring:
  profiles: "local-test"

---
marvel:
  env:
    name: "Marvel Dev Environment with RDS Postgres"
    description: "A shared database for developer testing"
  scheduling:
    enabled: true

server:
  port: 80

spring:
  profiles: "marvel-dev"
  datasource:
    url: "jdbc:postgresql://marvel2-dev.cchrzodxlhy6.us-west-2.rds.amazonaws.com:5432/marvel_dev"
    username: "postgres"
    password: "marvel20"
    driver-class-name: "org.postgresql.Driver"
  flyway:
    locations: "classpath:db/migration/pre_base_line/common,classpath:db/migration/pre_base_line/postgres"
  jpa:
    properties:
      hibernate:
        dialect: "org.hibernate.dialect.PostgreSQLDialect"

vault:
  uri: "https://vault.zooxlabs.com:8200"

---
marvel:
  env:
    name: "Marvel Test Environment with RDS Postgres"
    description: "Testing environment for users"
  scheduling:
    enabled: true

server:
  port: 80

spring:
  profiles: "marvel-test"
  datasource:
    url: "jdbc:postgresql://marvel2-test.cchrzodxlhy6.us-west-2.rds.amazonaws.com:5432/marvel_test"
    username: "postgres"
    password: "marvel20"
    driver-class-name: "org.postgresql.Driver"
  flyway:
    locations: "classpath:db/migration/pre_base_line/common,classpath:db/migration/pre_base_line/postgres"
  jpa:
    properties:
      hibernate:
        dialect: "org.hibernate.dialect.PostgreSQLDialect"

vault:
  uri: "https://vault.zooxlabs.com:8200"
