1 Star 0 Fork 0

yinheli/dev-env-zxr

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
helmfile.yaml 2.95 KB
一键复制 编辑 原始数据 按行查看 历史
yinheli 提交于 2024-11-08 01:01 . fix: cmd format
helmDefaults:
wait: false
atomic: true
timeout: 600
environments:
default:
values:
- values/.env-default.yaml
---
releases:
{{- range $serviceName, $serviceConfig := .Environment.Values.services }}
- name: {{ $serviceName }}
namespace: dev
chart: ./charts/golang-dev
# {{- if hasKey $serviceConfig "dependencies" }}
# needs:
# {{- range $dep := $serviceConfig.dependencies }}
# - {{ $dep }}
# {{- end }}
# {{- end }}
values:
- nameOverride: {{ $serviceName }}
service:
port: {{ $serviceConfig.port }}
{{- if hasKey $serviceConfig "envVars" }}
envVars:
{{- toYaml $serviceConfig.envVars | nindent 10 }}
{{- end }}
{{- $cmd := "" }}
{{- if hasKey $serviceConfig "cmd" }}
{{- $cmd = $serviceConfig.cmd }}
{{- else if hasKey $.Environment.Values "cmd" }}
{{- $cmd = $.Environment.Values.cmd }}
{{- end }}
{{- if ne $cmd "" }}
cmd: |-
{{- $cmd | nindent 10 }}
{{- end }}
{{- if hasKey $serviceConfig "ingress" }}
ingress:
enabled: true
hosts:
- host: {{ $serviceName }}.local
paths:
- path: /
pathType: Prefix
{{- end }}
{{- $volumes := list }}
{{- if hasKey $.Environment.Values "volumes" }}
{{- $volumes = $.Environment.Values.volumes }}
{{- end }}
{{- if hasKey $serviceConfig "volumes" }}
{{- $volumes = concat $volumes $serviceConfig.volumes }}
{{- end }}
{{- if ne (len $volumes) 0 }}
volumes:
{{- toYaml $volumes | nindent 8 }}
{{- end }}
{{- $volumeMounts := list }}
{{- if hasKey $.Environment.Values "volumeMounts" }}
{{- $volumeMounts = $.Environment.Values.volumeMounts }}
{{- end }}
{{- if hasKey $serviceConfig "volumeMounts" }}
{{- $volumeMounts = concat $volumeMounts $serviceConfig.volumeMounts }}
{{- end }}
{{- if ne (len $volumeMounts) 0 }}
volumeMounts:
{{- toYaml $volumeMounts | nindent 8 }}
{{- end }}
{{- $hostAliases := list }}
{{- if hasKey $.Environment.Values "hostAliases" }}
{{- $hostAliases = $.Environment.Values.hostAliases }}
{{- end }}
{{- if hasKey $serviceConfig "hostAliases" }}
{{- $hostAliases = concat $hostAliases $serviceConfig.hostAliases }}
{{- end }}
{{- if $hostAliases }}
hostAliases:
{{- toYaml $hostAliases | nindent 8 }}
{{- end }}
{{- if hasKey $serviceConfig "dependencies" }}
serviceDependencies:
{{- range $dep := $serviceConfig.dependencies }}
{{- if eq $dep "etcd" }}
etcd: "etcd:2379"
{{- else }}
{{- $depConfig := index $.Environment.Values.services $dep }}
{{ $dep }}: "{{ $dep }}:{{ $depConfig.port }}"
{{- end }}
{{- end }}
{{- end }}
{{- end }}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yinheli/dev-env-zxr.git
git@gitee.com:yinheli/dev-env-zxr.git
yinheli
dev-env-zxr
dev-env-zxr
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385