sap-tutorials / Issues

Creative Commons Attribution 4.0 International
6 stars 4 forks source link

Getting error while building the service container using paketo for cap java project #715

Open anand1694 opened 1 year ago

anand1694 commented 1 year ago

I followed this tutorial https://developers.sap.com/mission.cap-java-app.html for building a CAP java application(bookstore) and was able to connect it with hana db from business application studio. Now, I am trying to use the same project locally and follow this tutorial : https://developers.sap.com/tutorials/btp-app-kyma-deploy-application.html to deploy the application to kyma environment. Presently, I am facing issues while building service container using paketo. I faced similar issues while trying to build hana-deployer for another sample project.

I am running this command : pack build $CONTAINER_REGISTRY/bookstore-srv --path gen/srv \ --buildpack gcr.io/paketo-buildpacks/nodejs \ --builder paketobuildpacks/builder:base

and getting this error: ERROR: failed to build: invalid app path 'gen/srv': evaluate symlink: lstat gen: no such file or directory

UPDATE: I was able to build the CAP service by using this command : pack build $YOUR_CONTAINER_REGISTRY/bookstore-srv \ --path srv/target/*-exec.jar \ --buildpack gcr.io/paketo-buildpacks/sap-machine \ --buildpack gcr.io/paketo-buildpacks/java \ --builder paketobuildpacks/builder:base \ --env SPRING_PROFILES_ACTIVE=cloud

But I am again getting error in building hana deployer image: [ERROR] Build task [hana] could not be resolved - folder src [/db] does not exist at BuildTaskProviderFactory.resolveTask (/home/cnb/.npm/_npx/b078a26bcd6d600c/node_modules/@sap/cds-dk/node_modules/@sap/cds/bin/build/buildTaskProviderFactory.js:127:19)

I am running this command : pack build $CONTAINER_REGISTRY/bookstore-hana-deployer --path gen/db \ --buildpack gcr.io/paketo-buildpacks/nodejs \ --builder paketobuildpacks/builder:base

I have tried with path as /db as well but it doesn't work either.