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

Apply before-all for mbt sbom-gen #1112

Open
Fabian-K opened this issue Mar 4, 2024 · 0 comments
Open

Apply before-all for mbt sbom-gen #1112

Fabian-K opened this issue Mar 4, 2024 · 0 comments

Comments

@Fabian-K
Copy link

Fabian-K commented Mar 4, 2024

A typical CAP project relies on before-all to build the project. As an example, the following mta.yaml is generated by cds init & cds add mta

---
_schema-version: '3.1'
ID: bookshop
version: 1.0.0
description: "A simple CAP project."
parameters:
  enable-parallel-deployments: true
build-parameters:
  before-all:
    - builder: custom
      commands:
        - npx cds build --production
modules:
  - name: bookshop-srv
    type: nodejs
    path: gen/srv
    parameters:
      buildpack: nodejs_buildpack
    build-parameters:
      builder: npm
    provides:
      - name: srv-api # required by consumers of CAP services (e.g. approuter)
        properties:
          srv-url: ${default-url}
    requires: []

Executing mbt sbom-gen for such a project fails with the following error because gen/srv is generated by cds build within before-all.

[2024-03-04 12:27:54]  INFO start to generate some file
[2024-03-04 12:27:54]  INFO start to generate sbom for module ...
[2024-03-04 12:27:54]  INFO executing the "npm install" command...
Error: generate sbom file failed: could not execute the "npm install" command: chdir /workspace/source/gen/srv: no such file or directory
[2024-03-04 12:27:54] ERROR generate sbom file failed: could not execute the "npm install" command: chdir /workspace/source/gen/srv: no such file or directory

Can mbt sbom-gen be updated to apply before-all steps before generating the sbom?

Thanks, Fabian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant