Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.

Improved usecases documentation and enhancements #480

Merged
merged 1 commit into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions usecases/released/discoverycenter/3638-kyma-multitenant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,32 @@ docker container run --rm -it --name "btp-setup-automator" "ghcr.io/sap-samples/
> ⚠ NOTE: If you are running on an ARM based platform like a Mac M1 or M2 and are facing issues with the image, add the `--platform linux/amd64` option to the `docker container run command`. The image we provide is built for `linux/amd64` and due to some implicit dependencies we cannot perform a built for `linux/arm64` with the alpine linux as base image.

You'll notice that the prompt in your terminal has changed, because you are now working inside the docker container, that you just started.

Before we run the main script you should modify the parameter.json inside the container and add your email address in the member section:
1. Navigate to the parameter file
```bash
cd usecases/released/discoverycenter/3999-kyma-day2-operations
```
1. Open the parameter.json in vi
```bash
vi parameter.json
```
1. Search for "myusergroups" and enter your email address in the free line below the members tag:
```json
"myusergroups": [
{
"name": "admins",
"members": [
"[email protected]"
]
}
]
```
1. Save your changes
```bash
:wq
```

Now run the main script `btpsa` with the following command:

```bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,45 @@ docker container run --rm -it --name "btp-setup-automator" "ghcr.io/sap-samples/

> ⚠ NOTE: If you are running on an ARM based platform like a Mac M1 or M2 and are facing issues with the image, add the `--platform linux/amd64` option to the `docker container run command`. The image we provide is built for `linux/amd64` and due to some implicit dependencies we cannot perform a built for `linux/arm64` with the alpine linux as base image.

You'll notice that the prompt in your terminal has changed, because you are now working inside the docker container, that you just started.
You'll notice that the prompt in your terminal has changed, because you are now working inside the docker container, that you just started.

Before we run the main script you should modify the parameter.json inside the container and add your email address in the member section:
1. Navigate to the parameter file
```bash
cd usecases/released/discoverycenter/3999-kyma-day2-operations
```
1. Open the parameter.json in vi
```bash
vi parameter.json
```
1. Search for "myusergroups" and enter your email address in the free line below the members tag:
```json
"myusergroups": [
{
"name": "admins",
"members": [
"[email protected]"
]
}
]
```
1. Save your changes
```bash
:wq
```

Now run the main script `btpsa` with the following command:

There are two variants available, the first one is setting up the account so that you can get started with the mission and perform the necessary actions to complete the mission on your own. The other one will set up the final result of the mission so that you do not need to perform any changes. For best experience the first variant is recommended.

For setting up the account to get started with the mission use:
```bash
./btpsa -parameterfile 'usecases/released/discoverycenter/3999-kyma-day2-operations/parameters.json' -globalaccount '<your global account subdomain as shown in the SAP BTP cockpit>' -myemail '<your email address>'
```

> Note: Before the deployment starts you can choose between two options (Mission-start and Mission-end). The Mission-start option will setup the account and necessary application in order to execute the mission and enhance the existing application with the day2 operation features. The Mission-end option contains all tasks from the mission itself and you don't need to go through the mission steps. For the complete experience it is recommended to choose the Mission-start option.
For setting up the account with all changes performed throughout the mission use:
```bash
./btpsa -parameterfile 'usecases/released/discoverycenter/3999-kyma-day2-operations/parameters.json' -usecasefile 'usecases/released/discoverycenter/3999-kyma-day2-operations/usecase-final.json' -globalaccount '<your global account subdomain as shown in the SAP BTP cockpit>' -myemail '<your email address>'
```

The btp-setup-automator script will now prepare your SAP BTP account to cover the discovery center mission. You can have a look at the [usecase.json](usecase.json) and [parameters.json](parameters.json) for more details about the used services and configuration parameters (e.g. DB Password for SAP HANA Cloud).
The btp-setup-automator script will now prepare your SAP BTP account to cover the discovery center mission. You can have a look at the [usecase.json](usecase.json)/[usecase-final.json](usecase-final.json) and [parameters.json](parameters.json) for more details about the used services and configuration parameters (e.g. DB Password for SAP HANA Cloud).
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://raw.githubusercontent.com/SAP-samples/btp-setup-automator/main/libs/btpsa-usecase.json",
"aboutThisUseCase": {
"name": "Develop a Multitenant Extension Application in SAP BTP, Kyma Runtime - Consumer Account creation",
"description": "This project contains a reference application, showcasing an end-to-end development scenario for a multitenant extension on SAP BTP Kyma runtime, which has an SAP partner as focus persona.",
"author": "[email protected]",
"testStatus": "tested successfully",
"usageStatus": "READY TO BE USED",
"relatedLinks": [
"https://github.com/SAP-samples/btp-kyma-multitenant-extension"
]
},
"assignrolecollections": [
{
"name": "Easy Franchise Day 2 Operator",
"type": "account",
"level": "sub account",
"assignedUserGroupsFromParameterFile": [
"admins"
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"$schema": "https://raw.githubusercontent.com/SAP-samples/btp-setup-automator/main/libs/btpsa-usecase.json",
"aboutThisUseCase": {
"name": "Extend a Kyma based multitenant application with day 2 operations",
"description": "This project contains a reference application, showcasing an end-to-end development scenario for a multitenant extension on SAP BTP Kyma runtime, which has an SAP partner as focus persona.",
"author": "[email protected]",
"testStatus": "tested successfully",
"usageStatus": "READY TO BE USED",
"relatedLinks": [
"https://github.com/SAP-samples/btp-kyma-day2-operations"
]
},
"services": [
{
"category": "ENVIRONMENT",
"name": "kymaruntime",
"plan": "free",
"amount": 1,
"parameters": {
"name": "btp-auto-setup",
"region": "us-east-1"
}
},
{
"name": "destination",
"plan": "lite",
"entitleonly": true,
"targetenvironment": "sapbtp",
"category": "SERVICE"
},
{
"name": "xsuaa",
"plan": "broker",
"entitleonly": true,
"targetenvironment": "sapbtp",
"category": "SERVICE"
},
{
"name": "hana-cloud",
"plan": "hana-free",
"category": "SERVICE",
"targetenvironment": "sapbtp",
"repeatstatusrequest": 60,
"repeatstatustimeout": 3600,
"instancename": "EasyFranchiseHANADB",
"parameters": {
"data": {
"edition": "cloud",
"memory": 30,
"serviceStopped": false,
"storage": 120,
"systempassword": "mySAP123",
"vcpu": 0,
"versionIndicator": "",
"whitelistIPs": [
"0.0.0.0/0"
]
}
}
},
{
"name": "hana-cloud-tools",
"plan": "tools",
"targetenvironment": "sapbtp",
"category": "APPLICATION",
"repeatstatusrequest": 10,
"repeatstatustimeout": 120,
"requiredrolecollections": [
{
"name": "SAP HANA Cloud Administrator",
"assignedUserGroupsFromParameterFile": [
"admins"
]
}
]
},
{
"name": "cicd-app",
"plan": "free",
"targetenvironment": "sapbtp",
"category": "APPLICATION",
"repeatstatusrequest": 10,
"repeatstatustimeout": 120,
"requiredrolecollections": [
{
"name": "CICD Service Administrator",
"assignedUserGroupsFromParameterFile": [
"admins"
]
}
]
}
],
"executeAfterAccountSetup": [
{
"description": "Get the tutorial code",
"command": "rm -rf /home/user/tutorial && git clone https://github.com/SAP-samples/btp-kyma-day2-operations.git /home/user/tutorial"
},
{
"description": "Copy deploymentscript",
"command": "cp /home/user/tutorial/code/setup/btp-setup-automator/btpsa-deployment.sh /home/user/tutorial"
},
{
"description": "Change permission on deployment script",
"command": "chmod 777 /home/user/tutorial/btpsa-deployment.sh"
},
{
"description": "Run deployment script",
"command": "/home/user/tutorial/btpsa-deployment.sh -v=2"
},
{
"description": "Create the customer usecasefile",
"command": "rm /home/user/usecases/released/discoverycenter/3999-kyma-day2-operations/usecase-customer.json -f && SUBDOMAIN=$(jq -r '.\"subdomain\"' /home/user/log/metadata_log.json) && sed \"s~<provider-subdomain>~$SUBDOMAIN~g\" \"/home/user/usecases/released/discoverycenter/3999-kyma-day2-operations/usecase-customer-template.json\" >> \"/home/user/usecases/released/discoverycenter/3999-kyma-day2-operations/usecase-customer.json\""
},
{
"description": "Execute day2 role assignment usecase",
"command": "GLOBALACCOUNT=$(jq -r '.\"globalaccount\"' /home/user/log/metadata_log.json) && ./btpsa -parameterfile 'usecases/released/discoverycenter/3999-kyma-day2-operations/parameters.json' -usecasefile 'usecases/released/discoverycenter/3999-kyma-day2-operations/usecase-day2role.json' -globalaccount $GLOBALACCOUNT -myemail $MYEMAIL"
},
{
"description": "Execute customer usercase",
"command": "GLOBALACCOUNT=$(jq -r '.\"globalaccount\"' /home/user/log/metadata_log.json) && MYEMAIL=$(jq -r '.\"myemail\"' /home/user/log/metadata_log.json) && SUBACCOUNT=$(jq -r '.\"subaccount\"' /home/user/log/metadata_log.json) && SUBACCOUNTID=$(jq -r '.\"subaccountid\"' /home/user/log/metadata_log.json) && ./btpsa -parameterfile 'usecases/released/discoverycenter/3999-kyma-day2-operations/parameters.json' -usecasefile 'usecases/released/discoverycenter/3999-kyma-day2-operations/usecase-customer.json' -globalaccount $GLOBALACCOUNT -myemail $MYEMAIL -subaccountname CityScooter -customAppProviderSubaccountId $SUBACCOUNTID"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@
},
{
"description": "Run deployment script",
"command": "/home/user/tutorial/btpsa-deployment.sh"
},
"command": "/home/user/tutorial/btpsa-deployment.sh -v=1"
},
{
"description": "Create the customer usecasefile",
"command": "rm /home/user/usecases/released/discoverycenter/3999-kyma-day2-operations/usecase-customer.json -f && SUBDOMAIN=$(jq -r '.\"subdomain\"' /home/user/log/metadata_log.json) && sed \"s~<provider-subdomain>~$SUBDOMAIN~g\" \"/home/user/usecases/released/discoverycenter/3999-kyma-day2-operations/usecase-customer-template.json\" >> \"/home/user/usecases/released/discoverycenter/3999-kyma-day2-operations/usecase-customer.json\""
},
},
{
"description": "Execute customer usercase",
"command": "GLOBALACCOUNT=$(jq -r '.\"globalaccount\"' /home/user/log/metadata_log.json) && MYEMAIL=$(jq -r '.\"myemail\"' /home/user/log/metadata_log.json) && SUBACCOUNT=$(jq -r '.\"subaccount\"' /home/user/log/metadata_log.json) && SUBACCOUNTID=$(jq -r '.\"subaccountid\"' /home/user/log/metadata_log.json) && ./btpsa -parameterfile 'usecases/released/discoverycenter/3999-kyma-day2-operations/parameters.json' -usecasefile 'usecases/released/discoverycenter/3999-kyma-day2-operations/usecase-customer.json' -globalaccount $GLOBALACCOUNT -myemail $MYEMAIL -subaccountname CityScooter -customAppProviderSubaccountId $SUBACCOUNTID"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,32 @@ docker container run --rm -it --name "btp-setup-automator" "ghcr.io/sap-samples/
> ⚠ NOTE: If you are running on an ARM based platform like a Mac M1 or M2 and are facing issues with the image, add the `--platform linux/amd64` option to the `docker container run command`. The image we provide is built for `linux/amd64` and due to some implicit dependencies we cannot perform a built for `linux/arm64` with the alpine linux as base image.

You'll notice that the prompt in your terminal has changed, because you are now working inside the docker container, that you just started.

Before we run the main script you should modify the parameter.json inside the container and add your email address in the member section:
1. Navigate to the parameter file
```bash
cd usecases/released/discoverycenter/3999-kyma-day2-operations
```
1. Open the parameter.json in vi
```bash
vi parameter.json
```
1. Search for "myusergroups" and enter your email address in the free line below the members tag:
```json
"myusergroups": [
{
"name": "admins",
"members": [
"[email protected]"
]
}
]
```
1. Save your changes
```bash
:wq
```

Now run the main script `btpsa` with the following command:

```bash
Expand Down