SAP-archive / cloud-s4-sdk-pipeline-lib

The SAP Cloud SDK pipeline library defines essential functions for building cloud extension applications. The SAP Cloud SDK pipeline uses this library.
Apache License 2.0
27 stars 22 forks source link

Execution failure in mtaBuild step #31

Closed felixwaage closed 3 years ago

felixwaage commented 3 years ago

Hello all,

I am currently trying to implement a Pipeline to Test/Build/Deploy an CAP Application. Therefore, we decided to use the Cloud Sdk Pipeline. As build tool we are using the mbt build tool to build and deploy the cap app according to the mta.yaml. This Procedure works fine in a local environment. To realize an automated build we configured the pipeline as following:

config.yml: ### General project setup general: productiveBranch: development buildTool: mta

Unfortunately the mta build runs into the following error: Error: running command 'mbt' failed: starting command failed: exec: "mbt": executable file not found in $PATH

During debugging, I discovered the following behavior:

  1. For Build the Cloud SDK Pipeline calls the following pipeline stage: piperPipelineStageBuild here the environment variable _ONK8S equels true
  2. Following the stage piperPipelineStageBuild will execute the step dockerExecuteOnKubernetes with container Map: 'Container Map: [devxci/mbtci:1.0.14.1:mtabuild, ppiper/node-browsers:v3:npmexecutelint, maven:3.6.3-jdk-8-slim:mavenexecutestaticcodechecks]' (This seems to be correct for me)
  3. Inside this container the mtaBuild step will be executed.
  4. The mtaBuild step try to start another Docker Container (devxci/mbtci:1.0.14.1) which fails because there no environment variables available since we're already in the kubernetes environment created in step 2 (but I think this is correct) - environment variable _ONK8S equels null
  5. As fallback the pipeline trys to execute mbt locally inside the kubernetes environment. This will fail with the error message I already mentioned.

I suspect that the pipeline step dockerExecuteOnKubernetes is executing the wrong image and the mbt tool is not available there, but this cannot be confirmed via the container map since it should use the devxci/mbtci:1.0.14.1:mtabuild container.

I hope you can follow my description and if you need further information feel free to ask!

Thank you for your help. Felix!

daniel-kurzynski commented 3 years ago

As discussed closing this issue.