apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template "content-services.fullname" . }}-repository-configmap
  labels:
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
data:
  {{- if .Values.repository.environment }}
  {{- range $key, $val := .Values.repository.environment }}
  {{ $key }}: {{ $val | quote }}
  {{- end }}
  {{- end }}
  RELEASE_NAME: {{ .Release.Name }}
  CATALINA_OPTS: "-Dalfresco.host={{ template "content-services.fullname" . }}-repository
      -Dalfresco.port={{ .Values.repository.service.externalPort }}
      -Dshare.host={{ template "content-services.fullname" . }}-share
      -Dshare.port={{ .Values.share.service.externalPort }}
      -Ddb.driver={{ template "database.driver" . }}
      -Ddb.username={{ template "database.user" . }}
      -Ddb.password={{ template "database.password" . }}
      -Ddb.url=jdbc:{{ .Values.database.type }}://{{ template "database.hostname" . }}:{{ template "database.port" . }}/{{ .Values.postgresql.postgresDatabase }}
      -Dsolr.host={{ template "content-services.fullname" . }}-solr
      -Dsolr.port={{ .Values.solr.service.externalPort }}"
