-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Example for app + destination creation via content deployment
- Loading branch information
Showing
4 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
:toc: | ||
|
||
# Managing CF Apps with an MTA | ||
|
||
This example shows how to model a simple CF application in an MTA, and a SCP sub-account destination pointing to it's url. | ||
|
||
# Try out | ||
|
||
## Deploy an MTA containing an cf app. | ||
|
||
The example demostrate 2 different approaches that lead to the same result. | ||
|
||
### Deploy from directory | ||
That approach uses deployment descritpr `mtad.yaml` and ready application binaries `appBits.zip`: | ||
``` bash | ||
cf deploy ./ -f ; | ||
``` | ||
### Build and Deploy | ||
The approach is using development descriptor `mta.yaml`and application binaries `appBits.zip` to build MTAR. | ||
Then the MTAR is deployed. | ||
|
||
``` bash | ||
mbt build -p cf -t . ; | ||
cf deploy a.cf.app_0.0.0.mtar -f ; | ||
``` | ||
|
||
NOTE: See link:mta.yaml[mta.yaml] or link:mtad.yaml[mtad.yaml] for details on the attributes and environment and deployer parameters used. | ||
|
||
## Examine the result | ||
|
||
### List the deployed mta | ||
```bash | ||
$ cf mta a.cf.app ; | ||
Showing health and status ... | ||
OK | ||
Version: 0.0.0 | ||
Apps: | ||
name requested state instances memory disk urls | ||
my-cf-app started 1/1 1G 1G orgname-spacename-my-mta-managed-app-module.cfapps.sap.hana.ondemand.com, my-custom-host.at.some.domain | ||
``` | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
ID: a.cf.app | ||
_schema-version: 3.3.0 | ||
version: 0.0.0 | ||
modules: | ||
- name: destination-content-deployer | ||
type: com.sap.application.content | ||
build-parameters: | ||
no-source: true | ||
parameters: | ||
content: #whole content structure moved up to the module's parameters (was in the destinations') | ||
subaccount: | ||
destinations: | ||
- Name: backend | ||
URL: ~{backend-api/url} #from here, properties from different requires dependencies can be references - via ~{fully-qualified/references} | ||
forwardAuthToken: true | ||
ServiceInstanceName: "backend" | ||
requires: | ||
- name: destination-service | ||
parameters: | ||
content-target: true | ||
# content: # Inlinte content can not be defined as this any more! | ||
# subaccount: | ||
# destinations: | ||
# - Name: backend | ||
# URL: https://abc.d #because such values would have to be hard-coded | ||
# forwardAuthToken: true | ||
# ServiceInstanceName: "backend" | ||
- name: backend-api | ||
|
||
- name: backend | ||
type: application | ||
path: "appBits.zip" | ||
parameters: | ||
buildpack: staticfile_buildpack | ||
memory: 1G | ||
disk-quota: 1G | ||
provides: | ||
- name: backend-api | ||
properties: | ||
url: ${default-url} | ||
|
||
resources: | ||
- name: destination-service | ||
type: org.cloudfoundry.managed-service | ||
parameters: | ||
service: destination | ||
service-name: destination-service | ||
service-plan: lite | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
ID: a.cf.app | ||
_schema-version: 3.3.0 | ||
version: 0.0.0 | ||
modules: | ||
- name: destination-content-deployer | ||
type: com.sap.application.content | ||
parameters: | ||
content: #whole content structure moved up to the module's parameters (was in the destinations') | ||
subaccount: | ||
destinations: | ||
- Name: backend | ||
URL: ~{backend-api/url} #from here, properties from different requires dependencies can be references - via ~{fully-qualified/references} | ||
forwardAuthToken: true | ||
ServiceInstanceName: "backend" | ||
requires: | ||
- name: destination-service | ||
parameters: | ||
content-target: true | ||
# content: # Inlinte content can not be defined as this any more! | ||
# subaccount: | ||
# destinations: | ||
# - Name: backend | ||
# URL: https://abc.d #because such values would have to be hard-coded | ||
# forwardAuthToken: true | ||
# ServiceInstanceName: "backend" | ||
- name: backend-api | ||
|
||
- name: backend | ||
type: application | ||
path: "appBits.zip" | ||
parameters: | ||
buildpack: staticfile_buildpack | ||
memory: 1G | ||
disk-quota: 1G | ||
provides: | ||
- name: backend-api | ||
properties: | ||
url: ${default-url} | ||
|
||
resources: | ||
- name: destination-service | ||
type: org.cloudfoundry.managed-service | ||
parameters: | ||
service: destination | ||
service-name: destination-service | ||
service-plan: lite | ||
|