Skip to content

Commit

Permalink
consolidate docker image commands for prereqs
Browse files Browse the repository at this point in the history
  • Loading branch information
msdobrescu committed Aug 2, 2023
1 parent 6e1edfd commit 6048553
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/templates/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ prelude:

{{/* debug */}}
{{/* depends on which comes first out of the below debug functions, only the first one will be executed */}}
{{/* if eq .Values.name "openvdb" }}
{{/* if eq .Values.name "blender" }}
{{ template "cr.dump" ( include "cr.merge_shell_commands" ( include "cr.prereqs" ( list .Values $packages "" ) ) ) }}
{{ template "cr.dumpList" ( include "cr.prereqs" ( list .Values $packages "" ) ) }}
{{ include "cr.dumpJson" ( get ( ( printf "debug:\n %s" ( include "cr.prereqs" ( list .Values $packages "" ) ) ) | fromYaml ) "debug" ) }}
{{ end */}}
{{/* end debug */}}

{{ include "cr.prereqs" ( list .Values $packages "" ) }}
{{ $prereqs := include "cr.prereqs" ( list .Values $packages "" ) }}
- |
{{ ( include "cr.merge_shell_commands" $prereqs ) | indent 2 }}

{{ if eq .Values.category "layerbase" }}
- |
Expand All @@ -48,7 +51,7 @@ prelude:

{{/* debug */}}
{{/* depends on which comes first out of the below debug functions, only the first one will be executed */}}
{{/* if eq .Values.name "haskell" }}
{{/* if eq .Values.name "blender" }}
{{ template "cr.dumpList" ( include "cr.package_setup" .Values ) }}
{{ include "cr.dumpJson" ( get ( ( printf "debug:\n %s" ( include "cr.package_setup" .Values ) ) | fromYaml ) "debug" ) }}
{{ end */}}
Expand Down
16 changes: 16 additions & 0 deletions packages/templates/functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,22 @@

{{- end }}

################################################################################
## cr.merge_shell_commands ###
################################################################################

{{- define "cr.merge_shell_commands" }}

{{- $command := "" }}
{{- range ( get ( ( printf "list:\n %s" . ) | fromYaml ) "list" ) }}
{{- $command = printf "%s\n%s; \\" $command ( trimAll "; \n" . ) }}
{{- end }}
{{- $command = printf "%s\necho;" $command . }}

{{- $command }}

{{- end }}

################################################################################
## flatten ###
################################################################################
Expand Down

0 comments on commit 6048553

Please sign in to comment.