https://garden.io logo
#🌱|help-and-getting-started
generatedFiles alternative in bonsai
# 🌱|help-and-getting-started
p

plain-advantage-45962

06/09/2023, 2:16 PM
Hey there! We are migrating 0.12* configs to the latest 0.13 bonsai version and got an issue with
generatedFiles
. We need to create a few files before module build is started. Generated files will then be used during module build process. In 0.12* we used to use
generatedFiles
feature. In Bonsai I have tried to use Run action of type exec with the appropriate commands to create the files we need. The files are actually created, but a bit late in the process - they are created in the
sources
, but not copied over to the
build
. Would appreciate any ideas on how can we inject newly generated file in the build process. Here is a extract of the test garden.yml I'm playing with:
Copy code
---
kind: Run
type: exec
name: testbuild
spec:
    shell: true 
    command: ["echo '${var.private_file_content}' > ./tmp/private_file"]
---
kind: Build
type: container
name: testbuild
dependencies:
    - Run.testbuild
q

quaint-dress-831

06/13/2023, 12:33 PM
Hey @plain-advantage-45962 really sorry about the delay here: it's not usually like us! Have you tried instead using an
exec
Build as detailed at https://docs.garden.io/reference/action-types/configmap/container#build ?
That would allow you to do whatever generation you'd need to. The dependent action would then use the source path of the exec Build for its own, which should ensure files are generated before execution.