{"id":20484460,"url":"https://github.com/sap-samples/fiori-elements-v4-cap-advanced","last_synced_at":"2025-04-09T06:12:38.628Z","repository":{"id":65669915,"uuid":"495810282","full_name":"SAP-samples/fiori-elements-v4-cap-advanced","owner":"SAP-samples","description":"Learning journey to develop SAP Fiori Elements applications based on SAP CAP OData v4 services. Demonstrating advanced concepts required for many business applications.","archived":false,"fork":false,"pushed_at":"2025-03-07T13:23:44.000Z","size":7641,"stargazers_count":59,"open_issues_count":3,"forks_count":36,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-02T04:07:42.787Z","etag":null,"topics":["exercises","odata-v4","sample","sample-code","sap-cap","sap-fiori","sap-fiori-elements"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SAP-samples.png","metadata":{"files":{"readme":"README-Kyma-Runtime.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-24T12:20:01.000Z","updated_at":"2025-03-19T09:31:20.000Z","dependencies_parsed_at":"2024-12-18T05:16:19.991Z","dependency_job_id":null,"html_url":"https://github.com/SAP-samples/fiori-elements-v4-cap-advanced","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP-samples%2Ffiori-elements-v4-cap-advanced","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP-samples%2Ffiori-elements-v4-cap-advanced/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP-samples%2Ffiori-elements-v4-cap-advanced/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP-samples%2Ffiori-elements-v4-cap-advanced/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SAP-samples","download_url":"https://codeload.github.com/SAP-samples/fiori-elements-v4-cap-advanced/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247987285,"owners_count":21028895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["exercises","odata-v4","sample","sample-code","sap-cap","sap-fiori","sap-fiori-elements"],"created_at":"2024-11-15T16:22:35.024Z","updated_at":"2025-04-09T06:12:38.609Z","avatar_url":"https://github.com/SAP-samples.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deployment to SAP Business Technology Platform - Kyma Runtime\n\n- [Deployment to SAP Business Technology Platform - Kyma Runtime](#deployment-to-sap-business-technology-platform---kyma-runtime)\n  - [Preconditions](#preconditions)\n  - [Add Deployment Files](#add-deployment-files)\n  - [Configuration](#configuration)\n  - [Prepare Kubernetes Namespace](#prepare-kubernetes-namespace)\n    - [Create container registry secret](#create-container-registry-secret)\n    - [Create a secret for your HDI container](#create-a-secret-for-your-hdi-container)\n  - [Build - Node.js](#build---nodejs)\n  - [Build - Java](#build---java)\n  - [Build HTML5 application deployer image](#build-html5-application-deployer-image)\n  - [Push docker images](#push-docker-images)\n  - [Deployment](#deployment)\n  - [Access the UI](#access-the-ui)\n\n**TIP:** You can find more information in the [Deploy Your CAP Application on SAP BTP Kyma Runtime](https://developers.sap.com/mission.btp-deploy-cap-kyma.html) tutorial and in the [Deploy to Kyma/K8s](https://cap.cloud.sap/docs/guides/deployment/deploy-to-kyma) guide of the CAP documentation.\n\n## Preconditions\n\n- BTP Subaccount with Kyma Runtime\n- BTP Subaccount with Cloud Foundry Space\n- HANA Cloud instance available for your Cloud Foundry space\n- BTP Entitlements for: *HANA HDI Services \u0026 Container* plan *hdi-shared*, *Launchpad Service* plan *standard*\n- Container Registry\n- Command Line Tools: `kubectl`, `kubectl-oidc_login`, `pack`, `docker`, `helm`, `cf`\n- Logged into Kyma Runtime (with `kubectl` CLI), Cloud Foundry space (with `cf` CLI) and Container Registry (with `docker login`)\n- `@sap/cds-dk` \u003e= 6.0.1\n\n## Add Deployment Files\n\nCAP tooling provides your a Helm chart for deployment to Kyma.\n\nAdd the CAP Helm chart with the required features to this project:\n\n```bash\ncds add helm\ncds add helm:html5_apps_deployer\n```\n\n## Configuration\n\nThis project contains a pre-configured configuration file `deployment/kyma/values.yaml`, you just need to do the following changes in this file:\n\n- `\u003cyour-container-registry\u003e` - full-qualified hostname of your container registry\n- `domain`- full-qualified domain name used to access applications in your Kyma cluster\n\n## Prepare Kubernetes Namespace\n\n1. Export the kubeconfig.yaml\n\n    ```\n    set KUBECONFIG=~/.kube/cap-kyma-app-config\n    ```\n\n2. Setting the namespace\n\n    ```\n    kubectl config set-context --current --namespace=\u003c\u003cNAMESPACE\u003e\u003e\n    ```\n\n### Create container registry secret\n\nCreate a secret `container-registry` with credentials to access the container registry:\n\n```\nbash deployment/kyma/scripts/create-container-registry-secret.sh\n```\n\nThe *Docker Server* is the full-qualified hostname of your container registry.\n\n### Create a secret for your HDI container\n\n```\nbash deployment/kyma/scripts/create-db-secret.sh sflight-db\n```\n\n## Build - Node.js\n\nDo the following steps if you want to deploy the **Node.js** application.\n\nThe `CDS_ENV=node` env variable needs to be provided to build for Node.js. The application will be built for Java by default.\n\n```\nCDS_ENV=node cds build --production\n```\n**Build data base deployer image:**\n\n```\npack build $YOUR_CONTAINER_REGISTRY/sflight-hana-deployer \\\n     --path gen/db \\\n     --buildpack gcr.io/paketo-buildpacks/nodejs:0.16.1 \\\n     --builder paketobuildpacks/builder:base\n```\n(Replace `$YOUR_CONTAINER_REGISTRY` with the full-qualified hostname of your container registry)\n\n**Build image for CAP service:**\n\n```\npack build \\\n     $YOUR_CONTAINER_REGISTRY/sflight-srv \\\n     --path \"gen/srv\" \\\n     --buildpack gcr.io/paketo-buildpacks/nodejs \\\n     --builder paketobuildpacks/builder:base\n```\n\n## Build - Java\n\nDo the following steps if you want to deploy the **Java** application.\n\n**Build data base deployer image:**\n\n```\ncds build --production\n```\n\n```\npack build $YOUR_CONTAINER_REGISTRY/sflight-hana-deployer \\\n     --path db \\\n     --buildpack gcr.io/paketo-buildpacks/nodejs:0.16.1 \\\n     --builder paketobuildpacks/builder:base\n```\n\n(Replace `$YOUR_CONTAINER_REGISTRY` the full-qualified hostname of your container registry)\n\n**Build image for CAP service:**\n\n```\nmvn package\n```\n\n```\npack build $YOUR_CONTAINER_REGISTRY/sflight-srv \\\n     --path srv/target/*-exec.jar \\\n     --buildpack gcr.io/paketo-buildpacks/sap-machine \\\n     --buildpack gcr.io/paketo-buildpacks/java \\\n     --builder paketobuildpacks/builder:base \\\n     --env SPRING_PROFILES_ACTIVE=cloud\n```\n\n## Build HTML5 application deployer image\n\n```\nbash deployment/kyma/scripts/build-ui-image.sh\n```\n\n## Push docker images\n\nYou can push all the docker images to your docker registry, using:\n\n```\ndocker push $YOUR_CONTAINER_REGISTRY/sflight-hana-deployer\ndocker push $YOUR_CONTAINER_REGISTRY/sflight-srv\ndocker push $YOUR_CONTAINER_REGISTRY/sflight-html5-deployer\n```\n\n## Deployment\n\n```\nhelm upgrade sflight ./chart --install -f deployment/kyma/values.yaml\n```\n\n## Access the UI\n\n1. Create Launchpad Service subscription in the BTP Cockpit\n2. Create a role collection `sflight`\n3. Add role `admin` of `sflight.tXYZ` application to role collection\n4. Add your user to the role collection\n5. Goto **HTML5 Applications**\n6. Start HTML5 application `sapfecaptravel`\n\nAdditionally, you can add the UI to a Launchpad Service site like it is described in in the last two steps of [this tutorial](https://developers.sap.com/tutorials/btp-app-kyma-launchpad-service.html#9aab2dd0-18ea-4ccd-bc44-24e87c845740).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsap-samples%2Ffiori-elements-v4-cap-advanced","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsap-samples%2Ffiori-elements-v4-cap-advanced","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsap-samples%2Ffiori-elements-v4-cap-advanced/lists"}