Skip to content

Commit 593dee6

Browse files
Reviewed and updated
1 parent 5bbafc7 commit 593dee6

1 file changed

Lines changed: 44 additions & 32 deletions

File tree

tutorials/btp-cf-deploy-mta/btp-cf-deploy-mta.md

Lines changed: 44 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
11
---
2+
parser: v2
23
author_name: Lilyana Rangelova
34
author_profile: https://github.com/lilyanarangelova
4-
title: Deploy Your First Multitarget Application
5-
description: Deploy a simple multitarget application (MTA) to SAP Business Technology Platform, Cloud Foundry environment using the MultiApps CF CLI Plugin.
65
auto_validation: true
76
time: 30
87
tags: [ tutorial>intermediate, products>sap-btp--cloud-foundry-environment]
98
primary_tag: products>sap-business-technology-platform
109
---
1110

11+
# Deploy Your First Multitarget Application
12+
<!-- description --> Deploy a simple multitarget application (MTA) to SAP Business Technology Platform, Cloud Foundry environment using the MultiApps CF CLI Plugin.
13+
1214
## Prerequisites
1315
- If you do not have a Cloud Foundry Trial subaccount and dev space on [SAP BTP Cockpit](https://cockpit.hanatrial.ondemand.com/cockpit/) yet, create your [Cloud Foundry Trial Account](hcp-create-trial-account) and, if necessary [Manage Entitlements](cp-trial-entitlements).
1416
- You have downloaded and installed the [cf command line client](https://github.com/cloudfoundry/cli#downloads) for Cloud Foundry as described in the tutorial [Install the Cloud Foundry Command Line Interface (CLI)](cp-cf-download-cli).
1517

16-
## Details
17-
### You will learn
18+
## You will learn
1819
- How to deploy a multitarget application (MTA) in Cloud Foundry environment
1920

21+
## Intro
2022
The example MTA demonstrates the creation of a service instance and an application, and the binding between them.
2123

2224
---
2325

24-
[ACCORDION-BEGIN [Step 1: ](Prepare a simple static application)]
26+
### Prepare a simple static application
27+
2528

2629

2730
1. Create an `index.html` file with the following content:
@@ -32,10 +35,9 @@ The example MTA demonstrates the creation of a service instance and an applicati
3235

3336
2. Archive the `index.html` file into a `content.zip` archive and place it to a directory that is called `my_first_mta`.
3437

35-
[DONE]
36-
[ACCORDION-END]
3738

38-
[ACCORDION-BEGIN [Step 2: ](Prepare the MTA deployment descriptor)]
39+
### Prepare the MTA deployment descriptor
40+
3941

4042
Copy the example below to an `mtad.yaml` file that is located in the `my_first_mta` directory.
4143

@@ -64,11 +66,10 @@ resources:
6466

6567
The MTA deployment descriptor comprises of an MTA module, which represents a simple static application, and an MTA resource, which represents an `application-logs` service instance with plan **lite**.
6668

67-
[DONE]
68-
[ACCORDION-END]
6969

7070

71-
[ACCORDION-BEGIN [Step 3: ](Install the MultiApps CF CLI Plugin)]
71+
### Install the MultiApps CF CLI Plugin
72+
7273

7374
Execute the following:
7475

@@ -77,10 +78,9 @@ cf add-plugin-repo CF-Community https://plugins.cloudfoundry.org
7778
cf install-plugin multiapps
7879
```
7980

80-
[DONE]
81-
[ACCORDION-END]
8281

83-
[ACCORDION-BEGIN [Step 4: ](Deploy the MTA)]
82+
### Deploy the MTA
83+
8484

8585
Execute the following:
8686

@@ -99,7 +99,7 @@ OK
9999
Operation ID: <MTA_OPERATION_ID>
100100
Deploying in org "deploy-service" and space "<SPACE>"
101101
Detected MTA schema version: "3"
102-
No deployed MTA detected - this is initial deployment
102+
No deployed MTA detected - this is initial deployment of MTA with ID "app"
103103
Detected new MTA version: "1.0.0"
104104
Processing service "my-first-app-service"...
105105
Creating service "my-first-app-service" from MTA resource "my-first-app-service"...
@@ -117,6 +117,8 @@ Skipping deletion of services, because the command line option "--delete-service
117117
Process finished.
118118
Use "cf dmol -i <MTA_OPERATION_ID>" to download the logs of the process.
119119
```
120+
<MTA_OPERATION_ID> is a unique identifier for each MTA operation. It can be later used for troubleshooting.
121+
120122
In the output example above, the `application my-first-app` is deployed and started. A service called `my-first-app-service` is also created and is bound to the application. Credentials are provisioned for the service instance and delivered to the application runtime in the `VCAP_SERVICES` environment variable.
121123

122124
>The example above shows the deployment from a directory where the MTA deployment descriptor is available.
@@ -128,10 +130,9 @@ cf deploy <PATH_TO_MTAR>
128130
129131
When triggering a deployment from a directory, the MTAR is built under the hood and it can be verified by checking the new file `app.mtar` in the current folder.
130132

131-
[DONE]
132-
[ACCORDION-END]
133133

134-
[ACCORDION-BEGIN [Step 5: ](Examine the results of deployment)]
134+
### Examine the results of deployment
135+
135136

136137
To check the application, execute:
137138

@@ -164,10 +165,25 @@ name service plan bound apps last operation
164165
my-first-app-service application-logs lite my-first-app create succeeded
165166
```
166167

167-
[DONE]
168-
[ACCORDION-END]
168+
All CF entities above compose the MTA with ID “app”. It can be displayed with the command:
169+
```Console Command
170+
$ cf mta app
171+
Showing health and status for multi-target app app in org <ORG> / space <SPACE> as <USER>...
172+
OK
173+
Version: 1.0.0
174+
Namespace:
175+
176+
Apps:
177+
name requested state instances memory disk urls
178+
my-first-app STARTED 1/1 10.9M 5.2M <ORG>-<SPACE>-my-first-app.<DEFAULT_DOMAIN>
179+
180+
Services:
181+
name service plan bound apps last operation
182+
my-first-app-service application-logs lite my-first-app create succeeded
183+
```
184+
185+
### Create an extension descriptor
169186

170-
[ACCORDION-BEGIN [Step 6: ](Create an extension descriptor)]
171187

172188
Extension descriptors are files complementary to the main deployment descriptor that provide additional data. They have a file extension `.mtaext` and are external to the MTA archive `.mtar`. They are used to provide deployment specific information, for example, credentials to external services.
173189

@@ -190,10 +206,9 @@ Extension descriptors are files complementary to the main deployment descriptor
190206
The extension descriptor is used to extend the MTA deployment descriptor (`mtad.yaml`), so that `my-first-app` will be scaled to two instances.
191207

192208

193-
[DONE]
194-
[ACCORDION-END]
195209

196-
[ACCORDION-BEGIN [Step 7: ](Deploy the MTA and the extension descriptor)]
210+
### Deploy the MTA and the extension descriptor
211+
197212

198213
Execute the following command:
199214
```Shell
@@ -233,10 +248,9 @@ Use "cf dmol -i <MTA_OPERATION_ID_2>" to download the logs of the process.
233248
```
234249

235250

236-
[DONE]
237-
[ACCORDION-END]
238251

239-
[ACCORDION-BEGIN [Step 8: ](Examine the results of deployment)]
252+
### Examine the results of deployment
253+
240254

241255
To verify that the application is scaled to two instances, execute:
242256

@@ -255,14 +269,12 @@ name requested state processes routes
255269
my-first-app started web:2/2 <ORG>-<SPACE>-my-first-app.<DEFAULT_DOMAIN>
256270
```
257271

258-
[DONE]
259-
[ACCORDION-END]
260272

261-
[ACCORDION-BEGIN [Step 9: ](Test yourself)]
273+
### Test yourself
274+
275+
262276

263277

264-
[VALIDATE_1]
265-
[ACCORDION-END]
266278

267279

268280

0 commit comments

Comments
 (0)