Skip to content

Commit

Permalink
Merge pull request #7 from sorry-cypress/allow-external-mongo-host
Browse files Browse the repository at this point in the history
Allow external mongo service
  • Loading branch information
fsmaia authored Jan 12, 2021
2 parents 51a4b3b + 3fa930b commit 477dd95
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 11 deletions.
4 changes: 2 additions & 2 deletions charts/sorry-cypress/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ apiVersion: v2
name: sorry-cypress
description: A Helm chart for Sorry Cypress
type: application
version: 0.1.7
version: 0.1.8
appVersion: 0.6.1
home: https://sorry-cypress.dev/
sources:
- https://github.com/sorry-cypress/sorry-cypress
- https://github.com/sorry-cypress/sorry-cypress
icon: https://sorry-cypress.dev/public/octolumbercat.png
maintainers:
- name: tico24
Expand Down
11 changes: 11 additions & 0 deletions charts/sorry-cypress/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,15 @@ Create the s3 secret
{{- with .Values.director.s3 }}
{{- printf .secretAccessKey | b64enc -}}
{{- end }}
{{- end }}

{{/*
Determine the MongoDB hostname.
*/}}
{{- define "mongo.hostname" -}}
{{- if .Values.mongo.enabled }}
{{- printf "%s-%s" (include "sorry-cypress-helm.fullname" .) "mongo" -}}
{{- else }}
{{- printf "%s" .Values.mongo.mongoServer -}}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/sorry-cypress/templates/deployment-director.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
- name: MONGODB_DATABASE
value: {{ .Values.director.environmentVariables.mongodbDatabase }}
- name: MONGODB_URI
value: mongodb://{{ include "sorry-cypress-helm.fullname" . }}-mongo:{{ .Values.mongo.service.port }}
value: mongodb://{{ include "mongo.hostname" . }}:{{ .Values.mongo.service.port }}
{{- end }}
- name: SCREENSHOTS_DRIVER
value: {{ .Values.director.environmentVariables.screenshotsDriver }}
Expand Down
18 changes: 10 additions & 8 deletions charts/sorry-cypress/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ api:
# hosts:
# - chart-example.local


dashboard:
image:
repository: agoldis/sorry-cypress-dashboard
Expand Down Expand Up @@ -75,7 +74,6 @@ dashboard:
# hosts:
# - chart-example.local


director:
image:
repository: agoldis/sorry-cypress-director
Expand All @@ -97,18 +95,18 @@ director:

environmentVariables:
# In memory, or Mongo.
# Valid options are:
# "../execution/in-memory"
# "../execution/mongo/driver"
# Valid options are:
# "../execution/in-memory"
# "../execution/mongo/driver"
executionDriver: "../execution/in-memory"

# Ignored if mongo.environmentVariables.executionDriver is set to "../execution/in-memory"
mongodbDatabase: sorry-cypress

# Dummy or S3
# Valid options are:
# "../screenshots/dummy.driver"
# "../screenshots/s3.driver"
# Valid options are:
# "../screenshots/dummy.driver"
# "../screenshots/s3.driver"
screenshotsDriver: "../screenshots/dummy.driver"

# https://sorry-cypress.dev/director/configuration
Expand Down Expand Up @@ -141,6 +139,10 @@ mongo:
# You need to ensure that mongo.environmentVariables.executionDriver is set to "../execution/mongo/driver" if you want mongo.enabled to be true.
enabled: false

# To use an external MongoDB instance, set enabled to false and uncomment
# the line below:
# mongoServer: ""

image:
repository: mongo
pullPolicy: Always
Expand Down

0 comments on commit 477dd95

Please sign in to comment.