You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+177-2Lines changed: 177 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,9 @@ Welcome to the bookshop-java project. It demonstrates how to build business appl
21
21
-[Using IntelliJ Idea (Community and Ultimate)](#using-intellij-idea-community-and-ultimate)
22
22
-[Database Setup and Spring Profiles](#database-setup-and-spring-profiles)
23
23
-[API_BUSINESS_PARTNER Remote Service and Spring Profiles](#api_business_partner-remote-service-and-spring-profiles)
24
-
-[Deploy to SAP Business Technology Platform](#deploy-to-sap-business-technology-platform)
24
+
-[Deploy to SAP Business Technology Platform, Cloud Foundry](#deploy-to-sap-business-technology-platform-cloud-foundry)
25
+
-[Deploy to SAP Business Technology Platform, Kyma Runtime](#deploy-to-sap-business-technology-platform-kyma-runtime)
26
+
-[Setup Authorizations in SAP Business Technology Platform](#setup-authorizations-in-sap-business-technology-platform)
25
27
-[Code Tour](#code-tour)
26
28
-[Get Support](#get-support)
27
29
-[License](#license)
@@ -195,7 +197,7 @@ The behavior of the API_BUSINESS_PARTNER remote service is controlled using prof
195
197
196
198
The profiles `sandbox` and `destination` can be combined with the `default` profile for [hybrid testing](https://cap.cloud.sap/docs/advanced/hybrid-testing) and with the `cloud` profile when deployed to the cloud.
197
199
198
-
## Deploy to SAP Business Technology Platform
200
+
## Deploy to SAP Business Technology Platform, Cloud Foundry
199
201
200
202
CAP Java applications can be deployed to the SAP Business Technology Platform either in single tenant or in multitenancy mode. See [Multitenancy in CAP Java](https://cap.cloud.sap/docs/java/multitenancy) for more information.
201
203
@@ -220,6 +222,179 @@ Deploy as Multitenant Application:
220
222
- Go to another subaccount in your global account, under subscriptions and subscribe to the application you deployed.
221
223
- Run `cf map-route bookshop-mt-app <YOUR DOMAIN> --hostname <SUBSCRIBER TENANT>-<ORG>-<SPACE>-bookshop-mt-app` or create and bind the route manually.
222
224
225
+
Before you can access the UI using the (tenant-specific) URL to the bookshop(-mt)-app application, make sure to [Setup Authorizations in SAP Business Technology Platform](#setup-authorizations-in-sap-business-technology-platform).
226
+
227
+
## Deploy to SAP Business Technology Platform, Kyma Runtime
228
+
229
+
**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.
230
+
231
+
### Preconditions
232
+
233
+
- BTP Subaccount with Kyma Runtime
234
+
- BTP Subaccount with Cloud Foundry Space
235
+
- HANA Cloud instance available for your Cloud Foundry space
236
+
- BTP Entitlements for: *HANA HDI Services & Container* plan *hdi-shared*, *Launchpad Service* plan *standard*
237
+
- Container Registry
238
+
- Command Line Tools: `kubectl`, `kubectl-oidc_login`, `pack`, `docker`, `helm`, `cf`
239
+
- Logged into Kyma Runtime (with `kubectl` CLI), Cloud Foundry space (with `cf` CLI) and Container Registry (with `docker login`)
240
+
-`@sap/cds-dk` >= 6.0.1
241
+
242
+
### Add Deployment Files
243
+
244
+
CAP tooling provides your a Helm chart for deployment to Kyma.
245
+
246
+
Add the CAP Helm chart with the required features to this project:
247
+
248
+
```bash
249
+
cds add helm:hana_deployer
250
+
cds add helm:xsuaa
251
+
cds add helm:html5_apps_deployer
252
+
```
253
+
254
+
#### Helm chart configuration
255
+
256
+
This project contains a pre-configured configuration file `values.yaml`, you just need to do the following changes in this file:
257
+
258
+
-`<your-container-registry>` - full-qualified hostname of your container registry
259
+
-`domain`- full-qualified domain name used to access applications in your Kyma cluster
260
+
261
+
#### Use API_BUSSINESS_PARTNER Remote Service (optional)
262
+
263
+
You can try the `API_BUSINESS_PARTNER` service with a real S/4HANA system with the following configuration:
264
+
265
+
1. Create either an on-premise or cloud destination in your subaccount.
266
+
267
+
2. Add the binding to the destination service for the service (`srv`) to the `values.yaml` file:
268
+
269
+
```yaml
270
+
srv:
271
+
...
272
+
bindings:
273
+
...
274
+
destinations:
275
+
serviceInstanceName: destinations
276
+
```
277
+
278
+
(The destination service instance is already configured)
279
+
280
+
3. Set the profiles `cloud` and `destination` active in your `values.yaml` file:
The *Docker Server* is the full qualified hostname of your container registry.
311
+
312
+
#### Create a HDI container and a secret
313
+
314
+
```
315
+
bash ./scripts/create-db-secret.sh bookshop-db
316
+
```
317
+
318
+
It will create a HDI container `bookshop-db` on your currently targeted Cloud Foundry space and creates a secret `bookshop-db` with the HDI container's credentials in your current Kubernetes namespace.
Before you can access the UI you should make sure to [Setup Authorizations in SAP Business Technology Platform](#setup-authorizations-in-sap-business-technology-platform).
378
+
379
+
1. Create a Launchpad Service subscription in the BTP Cockpit
380
+
2. Go to **HTML5 Applications**
381
+
3. Start any of the HTML5 applications
382
+
383
+
Additionally, you can add the UIs 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).
384
+
385
+
## Setup Authorizations in SAP Business Technology Platform
386
+
387
+
To access services and UIs that require specific authorizations (e.g. `admin`) you need to assign a corresponding role and role collections to your user in SAP BTP Cockpit.
388
+
389
+
1. For single-tenant applications open the subaccount where you deployed the `bookshop` application to. For multitenant applications open the subaccount where you subscribed to the `bookshop` application.
390
+
2. Navigate to *Security* -> *Roles*
391
+
3. Create a role with name `bookshop-admin` based on the `admin` role template of the `bookshop` application:
392
+
1. Enter a Business Partner ID of your S/4 system as value for the `businessPartner` attribute. When using the sandbox environment use `10401010`.
393
+
4. Navigate to *Security* -> *Role Collections*
394
+
5. Create a new role collection `bookshop-admin`:
395
+
1. Assign the `bookshop-admin` role to this role collection
396
+
2. Assign the role collection to your user
397
+
223
398
# Code Tour
224
399
225
400
Take the [guided tour](.tours) in VS Code through our CAP Samples for Java and learn which CAP features are showcased by the different parts of the repository. Just install the [CodeTour extension](https://marketplace.visualstudio.com/items?itemName=vsls-contrib.codetour) for VS Code.
0 commit comments