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
description: Deploy a simple multitarget application (MTA) to SAP Business Technology Platform, Cloud Foundry environment using the MultiApps CF CLI Plugin.
<!-- description --> Deploy a simple multitarget application (MTA) to SAP Business Technology Platform, Cloud Foundry environment using the MultiApps CF CLI Plugin.
13
+
12
14
## Prerequisites
13
15
- 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).
14
16
- 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).
15
17
16
-
## Details
17
-
### You will learn
18
+
## You will learn
18
19
- How to deploy a multitarget application (MTA) in Cloud Foundry environment
19
20
21
+
## Intro
20
22
The example MTA demonstrates the creation of a service instance and an application, and the binding between them.
21
23
22
24
---
23
25
24
-
[ACCORDION-BEGIN [Step 1: ](Prepare a simple static application)]
26
+
### Prepare a simple static application
27
+
25
28
26
29
27
30
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
32
35
33
36
2. Archive the `index.html` file into a `content.zip` archive and place it to a directory that is called `my_first_mta`.
34
37
35
-
[DONE]
36
-
[ACCORDION-END]
37
38
38
-
[ACCORDION-BEGIN [Step 2: ](Prepare the MTA deployment descriptor)]
39
+
### Prepare the MTA deployment descriptor
40
+
39
41
40
42
Copy the example below to an `mtad.yaml` file that is located in the `my_first_mta` directory.
41
43
@@ -64,11 +66,10 @@ resources:
64
66
65
67
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**.
66
68
67
-
[DONE]
68
-
[ACCORDION-END]
69
69
70
70
71
-
[ACCORDION-BEGIN [Step 3: ](Install the MultiApps CF CLI Plugin)]
Deploying in org "deploy-service" and space "<SPACE>"
101
101
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"
103
103
Detected new MTA version: "1.0.0"
104
104
Processing service "my-first-app-service"...
105
105
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
117
117
Process finished.
118
118
Use "cf dmol -i <MTA_OPERATION_ID>" to download the logs of the process.
119
119
```
120
+
<MTA_OPERATION_ID> is a unique identifier for each MTA operation. It can be later used for troubleshooting.
121
+
120
122
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.
121
123
122
124
>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>
128
130
129
131
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.
130
132
131
-
[DONE]
132
-
[ACCORDION-END]
133
133
134
-
[ACCORDION-BEGIN [Step 5: ](Examine the results of deployment)]
134
+
### Examine the results of deployment
135
+
135
136
136
137
To check the application, execute:
137
138
@@ -164,10 +165,25 @@ name service plan bound apps last operation
164
165
my-first-app-service application-logs lite my-first-app create succeeded
165
166
```
166
167
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
169
186
170
-
[ACCORDION-BEGIN [Step 6: ](Create an extension descriptor)]
171
187
172
188
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.
173
189
@@ -190,10 +206,9 @@ Extension descriptors are files complementary to the main deployment descriptor
190
206
The extension descriptor is used to extend the MTA deployment descriptor (`mtad.yaml`), so that `my-first-app` will be scaled to two instances.
191
207
192
208
193
-
[DONE]
194
-
[ACCORDION-END]
195
209
196
-
[ACCORDION-BEGIN [Step 7: ](Deploy the MTA and the extension descriptor)]
210
+
### Deploy the MTA and the extension descriptor
211
+
197
212
198
213
Execute the following command:
199
214
```Shell
@@ -233,10 +248,9 @@ Use "cf dmol -i <MTA_OPERATION_ID_2>" to download the logs of the process.
233
248
```
234
249
235
250
236
-
[DONE]
237
-
[ACCORDION-END]
238
251
239
-
[ACCORDION-BEGIN [Step 8: ](Examine the results of deployment)]
252
+
### Examine the results of deployment
253
+
240
254
241
255
To verify that the application is scaled to two instances, execute:
242
256
@@ -255,14 +269,12 @@ name requested state processes routes
255
269
my-first-app started web:2/2 <ORG>-<SPACE>-my-first-app.<DEFAULT_DOMAIN>
0 commit comments