Skip to content
Snippets Groups Projects
Verified Commit e4475f0b authored by David Hoese's avatar David Hoese
Browse files

Allow YAML settings to be provided by global values

parent 92929db7
No related branches found
No related tags found
No related merge requests found
Pipeline #54639 passed
stages: stages:
- test
- build image - build image
- test image - test image
- build chart - build chart
...@@ -20,6 +21,16 @@ include: ...@@ -20,6 +21,16 @@ include:
- project: 'cspp_geo/geosphere/geosphere-deploy' - project: 'cspp_geo/geosphere/geosphere-deploy'
file: '/helpers/build_chart.yaml' file: '/helpers/build_chart.yaml'
precommit:
# steal build image which includes python and
# use the tags to run on our usual runners
extends: .build_image
stage: test
before_script: []
script:
- python3 -m pip install --root-user-action=ignore --break-system-packages pre-commit
- pre-commit run -a
build_image_mapserver: build_image_mapserver:
extends: .build_image extends: .build_image
variables: variables:
......
exclude: '^$' exclude: '^$'
fail_fast: false fail_fast: false
repos: repos:
- repo: https://gitlab.com/vojko.pribudic.foss/pre-commit-update
rev: v0.4.0post1
hooks:
# Fix failure with `pre-commit autoupdate`
- id: pre-commit-update
args: [ --dry-run ]
- repo: https://github.com/PyCQA/flake8 - repo: https://github.com/PyCQA/flake8
rev: 4.0.1 rev: 7.1.1
hooks: hooks:
- id: flake8 - id: flake8
additional_dependencies: [flake8-docstrings, flake8-debugger, flake8-bugbear, mccabe] additional_dependencies: [flake8-docstrings, flake8-debugger, flake8-bugbear, mccabe]
args: [--max-complexity, "10"] args: [--max-complexity, "10"]
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0 rev: v4.6.0
hooks: hooks:
- id: trailing-whitespace - id: trailing-whitespace
- id: end-of-file-fixer - id: end-of-file-fixer
...@@ -16,10 +22,18 @@ repos: ...@@ -16,10 +22,18 @@ repos:
args: [--unsafe] args: [--unsafe]
exclude: ^chart/.*/templates/.*\.yaml exclude: ^chart/.*/templates/.*\.yaml
- repo: https://github.com/scop/pre-commit-shfmt - repo: https://github.com/scop/pre-commit-shfmt
rev: v3.4.2-1 rev: v3.9.0-1
hooks: hooks:
# Choose one of: # Choose one of:
- id: shfmt # native (requires Go to build) - id: shfmt # native (requires Go to build)
args: ["-i", "4"] args: ["-i", "4"]
#- id: shfmt-docker # Docker image (requires Docker to run) #- id: shfmt-docker # Docker image (requires Docker to run)
# #
- repo: local
hooks:
- id: helm-lint
name: "Lint Helm Chart"
entry: bash -c 'helm dependency update chart/* && helm lint chart/* --strict --with-subcharts'
language: system
files: ^chart/
pass_filenames: false
{{/* Overwrite local values with globals */}}
{{- $Values:= mergeOverwrite $.Values $.Values.global }}
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
...@@ -42,6 +44,11 @@ spec: ...@@ -42,6 +44,11 @@ spec:
secret: secret:
secretName: {{ .Values.database.postgresPasswordSecret }} secretName: {{ .Values.database.postgresPasswordSecret }}
{{- end }} {{- end }}
{{- if .Values.geosphereSettings.existingConfigMap }}
- name: settings-volume
configMap:
name: {{ .Values.geosphereSettings.existingConfigMap }}
{{- end }}
containers: containers:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
securityContext: securityContext:
...@@ -104,6 +111,10 @@ spec: ...@@ -104,6 +111,10 @@ spec:
name: {{ .Values.imageSource.s3Secret }} name: {{ .Values.imageSource.s3Secret }}
key: {{ .Values.imageSource.s3SecretKey}} key: {{ .Values.imageSource.s3SecretKey}}
{{- end }} {{- end }}
{{- if .Values.geosphereSettings.existingConfigMap }}
- name: GEOSPHERE_CONFIG
value: "/etc/geosphere-settings/{{ .Values.geosphereSettings.settingsFilename }}"
{{- end }}
volumeMounts: volumeMounts:
- name: src - name: src
mountPath: "/data" mountPath: "/data"
...@@ -116,6 +127,10 @@ spec: ...@@ -116,6 +127,10 @@ spec:
mountPath: "/secrets" mountPath: "/secrets"
readOnly: true readOnly: true
{{- end }} {{- end }}
{{- if .Values.geosphereSettings.existingConfigMap }}
- name: settings-volume
mountPath: /etc/geosphere-settings
{{- end }}
ports: ports:
- name: http - name: http
containerPort: 80 containerPort: 80
......
...@@ -2,12 +2,19 @@ ...@@ -2,12 +2,19 @@
# This is a YAML-formatted file. # This is a YAML-formatted file.
# Declare variables to be passed into your templates. # Declare variables to be passed into your templates.
global: {}
replicaCount: 1 replicaCount: 1
image: image:
repository: gitlab.ssec.wisc.edu:5555/cspp_geo/geosphere/geosphere-mapserver/geosphere-mapserver repository: gitlab.ssec.wisc.edu:5555/cspp_geo/geosphere/geosphere-mapserver/geosphere-mapserver
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
geosphereSettings:
# -- ConfigMap to mount as files containing a custom Settings YAML file
existingConfigMap: ""
# -- Key in existingConfigMap that should be used as the Settings YAML file
settingsFilename: "settings.yaml"
# Filter products to support based on the following # Filter products to support based on the following
# empty list => use defaults # empty list => use defaults
products: [] products: []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment