Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(gdk): Dynamically generated recipe.yaml leads to error #291

Open
emapple opened this issue Nov 15, 2024 · 0 comments
Open

(gdk): Dynamically generated recipe.yaml leads to error #291

emapple opened this issue Nov 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@emapple
Copy link

emapple commented Nov 15, 2024

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.

@emapple emapple added the bug Something isn't working label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant