Skip to content

Commit

Permalink
add option to add files in container
Browse files Browse the repository at this point in the history
  • Loading branch information
mberndt123 authored and jsoref committed Jun 20, 2024
1 parent ff9fe17 commit d575ca5
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
12 changes: 12 additions & 0 deletions charts/scala-steward/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,15 @@ data:
{{- tpl (.Files.Get "files/password.sh") . | nindent 4 }}
scalafix.conf: |
{{- .Values.scalafixConfig | nindent 4 }}
{{- if .Values.additionalFiles }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "scala-steward.fullname" . }}-files
data:
{{- range $k, $v := .Values.additionalFiles }}
{{ $k }}:
{{ $v.content | quote }}
{{- end }}
{{- end }}
15 changes: 15 additions & 0 deletions charts/scala-steward/templates/cron-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ spec:
name: opt
- mountPath: /var/scala-steward/workspace
name: workspace
{{- range $k, $v := .Values.additionalFiles }}
- mountPath: {{ $v.path }}
name: files
subPath: {{ $k }}
{{- end }}
volumes:
- name: opt
configMap:
Expand All @@ -63,3 +68,13 @@ spec:
- name: workspace
emptyDir: {}
{{- end }}
{{- if .Values.additionalFiles }}
- name: files
configMap:
name: {{ include "scala-steward.fullname" . }}-files
items:
{{- range $k, $v := .Values.additionalFiles }}
- key: {{ $k }}
path: {{ $k }}
{{- end }}
{{- end }}
8 changes: 8 additions & 0 deletions charts/scala-steward/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,11 @@ persistence:
accessModes:
- ReadWriteOnce
size: 5Gi

additionalFiles: {}
# this can be used to make files available in the container, e. g. for authentication for an artifact repository
# additionalFiles:
# nexusCredentials:
# path: /root/.sbt/1.0/credentials.sbt
# content: |
# credentials += Credentials(sys.env("NEXUS_REALM"), sys.env("NEXUS_HOST"), sys.env("NEXUS_USERNAME"), sys.env("NEXUS_PASSWORD"))

0 comments on commit d575ca5

Please sign in to comment.