Skip to content

Commit

Permalink
Merge pull request #446 from manala/lazy/required-env-files
Browse files Browse the repository at this point in the history
[Lazy] Handle "required" env_file
  • Loading branch information
nervo authored Sep 13, 2024
2 parents 1c4a564 + 9f1ce67 commit 82b13b4
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 6 deletions.
16 changes: 15 additions & 1 deletion lazy.ansible/.manala.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,21 @@ system:
# "propertyNames": {"pattern": "^[A-Z_]+$"}
# }
env: {}
# @schema {"type": ["string", "array"]}
# @schema {
# "type": ["string", "array"],
# "items": {"oneOf": [
# {"type": "string"},
# {
# "type": "object",
# "properties": {
# "path": {"type": "string"},
# "required": {"type": "boolean"}
# },
# "required": ["path"],
# "additionalProperties": false
# }
# ]}
# }
env_file: []
# @schema {"items": {"type": "string"}}
mount: []
Expand Down
4 changes: 4 additions & 0 deletions lazy.ansible/.manala.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ project:
##########

system:
# env_file:
# - .env
# - path: .env.local
# required: false
# apt:
# packages:
# - jq
Expand Down
5 changes: 5 additions & 0 deletions lazy.ansible/.manala/docker/compose.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ services:
{{- if kindIs "slice" .Vars.system.env_file }}
env_file:
{{- range $file := .Vars.system.env_file }}
{{- if kindIs "map" $file }}
{{- $file := set $file "path" (printf "../../%s" $file.path) }}
- {{ $file | toYaml | indent 14 | trim }}
{{- else }}
- ../../{{ $file }}
{{- end }}
{{- end }}
{{- else }}
env_file: ../../{{ .Vars.system.env_file }}
Expand Down
5 changes: 4 additions & 1 deletion lazy.ansible/test/.manala.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ system:
TEST: test
env_file:
- .env.1
- .env.2
- path: .env.2
required: false
- path: .env.3
required: false
docker: true
goss:
version: 0.4.8
Expand Down
16 changes: 15 additions & 1 deletion lazy.kubernetes/.manala.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,21 @@ system:
# "propertyNames": {"pattern": "^[A-Z_]+$"}
# }
env: {}
# @schema {"type": ["string", "array"]}
# @schema {
# "type": ["string", "array"],
# "items": {"oneOf": [
# {"type": "string"},
# {
# "type": "object",
# "properties": {
# "path": {"type": "string"},
# "required": {"type": "boolean"}
# },
# "required": ["path"],
# "additionalProperties": false
# }
# ]}
# }
env_file: []
# @schema {"items": {"type": "string"}}
mount: []
Expand Down
4 changes: 4 additions & 0 deletions lazy.kubernetes/.manala.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ project:
##########

system:
# env_file:
# - .env
# - path: .env.local
# required: false
# apt:
# packages:
# - jq
Expand Down
5 changes: 5 additions & 0 deletions lazy.kubernetes/.manala/docker/compose.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ services:
{{- if kindIs "slice" .Vars.system.env_file }}
env_file:
{{- range $file := .Vars.system.env_file }}
{{- if kindIs "map" $file }}
{{- $file := set $file "path" (printf "../../%s" $file.path) }}
- {{ $file | toYaml | indent 14 | trim }}
{{- else }}
- ../../{{ $file }}
{{- end }}
{{- end }}
{{- else }}
env_file: ../../{{ .Vars.system.env_file }}
Expand Down
5 changes: 4 additions & 1 deletion lazy.kubernetes/test/.manala.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ system:
TEST: test
env_file:
- .env.1
- .env.2
- path: .env.2
required: false
- path: .env.3
required: false
docker: true
goss:
version: 0.4.8
Expand Down
16 changes: 15 additions & 1 deletion lazy.symfony/.manala.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,21 @@ system:
# "propertyNames": {"pattern": "^[A-Z_]+$"}
# }
env: {}
# @schema {"type": ["string", "array"]}
# @schema {
# "type": ["string", "array"],
# "items": {"oneOf": [
# {"type": "string"},
# {
# "type": "object",
# "properties": {
# "path": {"type": "string"},
# "required": {"type": "boolean"}
# },
# "required": ["path"],
# "additionalProperties": false
# }
# ]}
# }
env_file: []
# @schema {"items": {"type": "string"}}
mount: []
Expand Down
4 changes: 4 additions & 0 deletions lazy.symfony/.manala.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ project:
##########

system:
# env_file:
# - .env
# - path: .env.local
# required: false
# apt:
# packages:
# - jq
Expand Down
5 changes: 5 additions & 0 deletions lazy.symfony/.manala/docker/compose.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ services:
{{- if kindIs "slice" .Vars.system.env_file }}
env_file:
{{- range $file := .Vars.system.env_file }}
{{- if kindIs "map" $file }}
{{- $file := set $file "path" (printf "../../%s" $file.path) }}
- {{ $file | toYaml | indent 14 | trim }}
{{- else }}
- ../../{{ $file }}
{{- end }}
{{- end }}
{{- else }}
env_file: ../../{{ .Vars.system.env_file }}
Expand Down
5 changes: 4 additions & 1 deletion lazy.symfony/test/.manala.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ system:
TEST: test
env_file:
- .env.1
- .env.2
- path: .env.2
required: false
- path: .env.3
required: false
docker: true
goss:
version: 0.4.4
Expand Down

0 comments on commit 82b13b4

Please sign in to comment.