Describe the bug
If a recipe.yaml does not already exist then gdk component build throws an error. This is a challenge if recipe.yaml is generated by gdk component build with a custom build system.
To Reproduce
Use the code below:
gdk-config.json
{
"component": {
"aws.greengrass.labs.CustomSecureTunneling": {
"author": "Foo Bar",
"version": "NEXT_PATCH",
"build": {
"build_system": "custom",
"custom_build_command": [
"bash",
"build-component.sh"
]
},
"publish": {
"bucket": "placeholder",
"region": "placeholder"
}
}
},
"gdk_version": "1.0.0"
}
build-component.sh
#!/usr/bin/env bash
mkdir -p ./greengrass-build/artifacts/my-component/1.0.0
mkdir -p ./greengrass-build/recipes/
cp recipe.yaml.template ./greengrass-build/recipes/recipe.yaml
recipe.yaml.template
---
RecipeFormatVersion: '2020-01-25'
ComponentName: my-component
ComponentVersion: '1.0.0'
ComponentDescription: My first AWS IoT Greengrass component.
ComponentPublisher: Amazon
Manifests:
- Platform:
os: linux
Lifecycle:
run: |
python3
Then run gdk component build
Expected behavior
I expect the component to be built
Actual behavior
I get the error Exception: No valid component recipe is found. Please include a valid recipe file of the component to build with default.
Environment
gdk 1.6.2
Additional context
The AWS documentation says
This command must create a recipe and artifacts in the following folders within the component folder.
so a recipe.yaml should be an output, not necessarily an input, of gdk component build.
Describe the bug
If a
recipe.yamldoes not already exist thengdk component buildthrows an error. This is a challenge ifrecipe.yamlis generated bygdk component buildwith a custom build system.To Reproduce
Use the code below:
gdk-config.json
{ "component": { "aws.greengrass.labs.CustomSecureTunneling": { "author": "Foo Bar", "version": "NEXT_PATCH", "build": { "build_system": "custom", "custom_build_command": [ "bash", "build-component.sh" ] }, "publish": { "bucket": "placeholder", "region": "placeholder" } } }, "gdk_version": "1.0.0" }build-component.sh
#!/usr/bin/env bash mkdir -p ./greengrass-build/artifacts/my-component/1.0.0 mkdir -p ./greengrass-build/recipes/ cp recipe.yaml.template ./greengrass-build/recipes/recipe.yamlrecipe.yaml.template
Then run
gdk component buildExpected behavior
I expect the component to be built
Actual behavior
I get the error
Exception: No valid component recipe is found. Please include a valid recipe file of the component to build with default.Environment
gdk 1.6.2
Additional context
The AWS documentation says
so a
recipe.yamlshould be an output, not necessarily an input, ofgdk component build.