A list of additional commands to deploy multitarget applications (MTA) to the Cloud Foundry environment.
The expiration time for all MTA operations in Cloud Foundry is 3 days. If an operation is still active when time limit is reached, it is automatically aborted.
Due to the missing shared domains in certain regions, as China (Shanghai), the URL of the SAP Cloud Deployment service should be specified by each multitarget application developer who uses MultiApps CF CLI plugin older that 3.0.0. If you are using MultiApps CF CLI plugin newer than 3.0.0, you do not need additional settings. You can do this by using the environment variable
MULTIAPPS_CONTROLLER_URL
, or the-u
option specified in the commands listed below.The URL of the deploy-service that needs to be set is in the following format:
deploy-service.cf.<domain>
The domain is derived from the Cloud Foundry API endpoint that you can find in the SAP BTP Cockpit in the Overview of your subaccount. For more information, see Deploying Applications inRegions and Regions and API Endpoints Available for the Cloud Foundry Environment.If you are using the
-u
option, make sure you have the MultiApps CLI Plugin version 2.1.3 or higherIf you are using region CN40 with API Endpoint api.cf.cn40.platform.sapcloud.cn, you need to specify the URL as follows:
export MULTIAPPS_CONTROLLER_URL=deploy-service.cf.cn40.platform.sapcloud.cn
Commands for the Cloud Foundry Environment Overview
Command |
Alias |
Description |
---|---|---|
|
Deploy a new Multitarget Application (MTA) or synchronize changes to an existing MTA. |
|
|
Deploy a Multitarget Application using “blue-green” (zero-downtime) deployment. |
|
|
Undeploy a Multitarget Application (MTA). |
|
|
Display information about a deployed Multitarget Application (MTA). |
|
|
List all deployed Multitarget Applications (MTA). |
|
|
List all active operations for Multitarget Applications. |
|
|
Download the log files for one or more operations concerning Multitarget Applications. |
|
|
Purge all configuration entries and subscriptions, which are no longer valid. |
By default, large multitarget applications are not uploaded as a single unit, but are split up into smaller chunks of 45 MBs that are uploaded separately. Configure the chunk size as described in Configuration.
Deploy a new MTA or synchronize changes to an existing one. You have the following options for doing this:
-
Deployment using a path to a directory
You have the option to deploy or synchronize an MTA, the source of which is contained in a local directory:
cf deploy MTA_ARCHIVE | DIRECTORY_PATH [-e EXT_DESCRIPTOR[,...]] [-t TIMEOUT] [--version-rule VERSION_RULE] [-u URL] [-f] [--retries RETRIES] [--no-start] [--namespace NAMESPACE] [--apply-namespace-app-names true/false] [--apply-namespace-service-names true/false] [--apply-namespace-app-routes true/false] [--apply-namespace-as-suffix true/false ] [--delete-services] [--delete-service-keys] [--delete-service-brokers] [--keep-files] [--no-restart-subscribed-apps] [--do-not-fail-on-missing-permissions] [--abort-on-error] [--strategy STRATEGY] [--skip-testing-phase] [--skip-idle-start] [--apps-start-timeout TIMEOUT] [--apps-stage-timeout TIMEOUT] [--apps-upload-timeout TIMEOUT] [--apps-task-execution-timeout TIMEOUT]
-
Deployment using a URL to the MTA archive
You have the option to deploy or synchronize an MTA, the source of which is contained at a URL address.When you use this command, the request prompts the backend to download the archive and then dеploy it:
This option is currently experimental.
<write MTA archive URL to STDOUT> | cf deploy [-e EXT_DESCRIPTOR[,...]] [-t TIMEOUT] [--version-rule VERSION_RULE] [-u MTA_CONTROLLER_URL] [--retries RETRIES] [--no-start] [--namespace NAMESPACE] [--apply-namespace-app-names true/false] [--apply-namespace-service-names true/false] [--apply-namespace-app-routes true/false] [--apply-namespace-as-suffix true/false ] [--delete-services] [--delete-service-keys] [--delete-service-brokers] [--keep-files] [--no-restart-subscribed-apps] [--do-not-fail-on-missing-permissions] [--abort-on-error] [--strategy STRATEGY] [--skip-testing-phase] [--skip-idle-start] [--apps-start-timeout TIMEOUT] [--apps-stage-timeout TIMEOUT] [--apps-upload-timeout TIMEOUT] [--apps-task-execution-timeout TIMEOUT]
There is no possibility for you to check if there are running ongoing operations on the MTA that you want to deploy using a URL.
- The URL to the MTA archive must include the https://\ prefix.
- You can use an locally present extension descriptor along with this deployment method.
-
Deployment from your current directory
You have the option to deploy the content of the directory you are currently in. The MultiApps CLI plugin packages the content in accordance with the deployment descriptor definition, so that the Cloud Deployment service can then upload and deploy the MTA.
cf deploy [-e <EXT_DESCRIPTOR_1>[,<EXT_DESCRIPTOR_2>]] [-u <URL>] [-t <TIMEOUT>] [-v <VERSION_RULE>] [--no-start] [--namespace] [--delete-services] [--delete-service-keys] [--delete-service-brokers] [][--keep-files] [--no-restart-subscribed-apps] [--do-not-fail-on-missing-permissions] [--skip-idle-start] cf deploy ...[--retries <RETRIES>]
In additon to deployment, you can also interact with an active MTA deploy operation, for example, by performing an action:
cf deploy [-i <OPERATION_ID>] [-a <ACTION>]
The Cloud Deployment service uses the content of the mtad.yaml descriptor, and based its contained info assembles an MTA archive in that directory before deploying it.
Command Arguments Overview
Argument |
Description |
---|---|
<MTA_ARCHIVE> |
The path to (and name of) the archive or the directory containing the Multitarget Application to deploy; the application archive must have the format (and file extension) |
<DIRECTORY_PATH> |
The Cloud Deployment service also accepts a path to a directory where an |
<--retries> |
Retry the operation specified number of times in case a non-content error (default 3). |
Command Options Overview
Option |
Description |
---|---|
|
Define one or more extensions to the deployment descriptors; multiple extension descriptors must be separated by commas. |
|
Specify the URL for the deployment-service end-point that is to be used for the deployment operation. |
|
Specify the maximum amount of time (in seconds) that the service must wait for before starting the deployed application. |
|
Specify the rule to apply to determine how the application version number is used to trigger an application-update deployment operation, for example: “ |
|
Specify the ID of the deploy operation that you want to perform an action on. |
|
Specify the action to perform on the deploy operation, for example, “abort”, “retry”, or “monitor”, or “resume”. |
|
Force deployment without requiring any confirmation about aborting any conflicting processes. |
|
Do not start application after deployment. |
|
Defines how long, in seconds, you can upload your application binary before the MTA operation times out. See Application-Specific Timeouts .
|
|
Defines how long, in seconds, your application can take during staging before the MTA operation times out. See Application-Specific Timeouts .
|
|
Defines how long, in seconds, your application can take to start before the MTA operation times out. See Application-Specific Timeouts .
|
|
Defines how long, in seconds, your application can take to execute a task before the MTA operation times out. See Application-Specific Timeouts .
|
|
Re-create changed services and delete discontinued services. |
|
Delete the existing service keys and apply the new ones. |
|
Delete discontinued service brokers. |
|
Keep the files used for deployment. |
|
Do not restart subscribed applications that are updated during the deployment. |
|
Perform the deployment, even if required administrator permissions are missing for some operations (for example, the creation of service brokers). |
|
If an operation fails, the corresponding process is automatically aborted and cannot be retried using the option -a retry. However, if you run a new operation for the same MTA, you will not receive an error message that there is an ongoing process for the MTA and ask you if you want to abort it. |
|
Deploy only the module with the specified name.
|
|
Deploy all modules.
|
|
Deploy only the resource with the specified name
|
|
Deploy all resources.
|
|
Announce to the platform a special deployment approach, for example when performing a “blue-green” or an “incremental-blue-green” deployment. See Blue-Green Deployment Strategy and (Experimental) Incremental Blue-Green Deployment Strategy. Using this option, you will not be asked to manually confirm the deletion of the older version of the MTA applications. This means that the deployment process is performed without any interruptions and you are not prompted to confirm the switch of routes to the new version of the MTA applications. |
|
When using the --strategy option for “blue-green” or “incremental-blue-green” deployment, you can choose to skip the testing phase and you will not be asked to manually confirm the deletion of the older version of the MTA applications. The deployment process is performed without any interruptions and you are not prompted to confirm the switch of routes to the new version of the MTA applications.
|
|
Namespace for the MTA. They are also applied to the application and service names. For more information, see (Experimental) Namespaces. |
|
Apply namespace to application names. If the namespace value is not provided in the CLI options, it is not applied.
|
|
Apply namespace to service names. If the namespace value is not provided in the CLI options, it is not applied.
|
|
Apply namespace to application routes. If the namespace value is not provided in the CLI options, it is not applied.
|
|
Apply namespace as suffix. If the namespace value is not provided in the CLI options, it is not applied.
|
|
When using the --strategy option for “blue-green”, you can choose to skip the starting of the newly deployed applications on idle routes. This means that the newly deployed applications will be mapped directly to live routes. Under the hood this option includes --skip-testing-phase. |
- If any of the options
-m
,--all-modules
,-r
,--all-resource
is used, only the specified modules and resources will be deployed. Otherwise, everything will be deployed by default.- If the options for the module deploying (
-m
,--all-modules
) are used, the modules need to contain apath
element on an MTA module level, which points to the content of the module. In case the module has somerequires
dependency section to a resource that needs a configuration file, then therequires
section should have apath
parameter, which points to the configuration file.- If the options for the resource deploying (
-r
,--all-resource
) are used, then any resources that have some configuration files need to contain apath
parameter in their parameters section, which points to the configuration file.- The
path
element or parameter value should be relative to the MTA directory.An example of an MTA deployment descriptor, containing all variants of the
path
elements and parameters can be found at Defining Multitarget Application Deployment Descriptors for Cloud Foundry.
Deploy a new Multitarget Application (MTA) using “blue-green” (zero-downtime) deployment.
You can also perform this deployment type using the
deploy
command by using the experimental--strategy blue-green
flag. See above for details.
“Blue-green” deployment is a release technique that reduces application downtime and the resulting risk by running two identical target deployment environments called “blue” and “green”. Only one of the two target environments is “live” at any point in time and it is much easier to roll back to a previous version after a failed (or undesired) deployment.
Deploy a new Multitarget Application using “blue-green” deployment:
cf bg-deploy <MTA_ARCHIVE>
[-e <EXT_DESCRIPTOR_1>[,<EXT_DESCRIPTOR_2>]]
[-u <URL>] [-t <TIMEOUT>] [-v <VERSION_RULE>]
[--no-start] [--use-namespaces] [--no-namespaces-for-services]
[--delete-services] [--delete-service-keys] [--delete-service-brokers]
[--keep-files] [--no-restart-subscribed-apps] [--no-confirm] [--do-not-fail-on-missing-permissions][--skip-idle-start]
cf deploy ...[--retries <RETRIES>]
Interact with an active MTA deploy operation, for example, by performing an action:
cf bg-deploy [-i <OPERATION_ID>] [-a <ACTION>]
Command Arguments Overview
Argument |
Description |
---|---|
<MTA_ARCHIVE> or <DIRECTORY_PATH> |
The path to (and name of) the archive or the path to the directory containing the Multitarget Application to deploy. The application archive must have the format (and file extension) |
<--retries> |
Retry the operation specified number of times in case a non-content error (default 3). |
Command Options Overview
Option |
Description |
---|---|
|
Define one or more extensions to the deployment descriptors; multiple extension descriptors must be separated by commas. |
|
Specify the URL for the deployment-service end-point that is to be used for the deployment operation. |
|
Specify the maximum amount of time (in seconds) that the service must wait for before starting the deployed application. |
|
Specify the rule to apply to determine how the application version number is used to trigger an application-update deployment operation, for example: “ |
|
Specify the ID of the deploy operation that you want to perform an action on. |
|
Specify the action to perform on the deploy operation, for example, “abort”, “retry”, or “monitor”, or “resume”. |
|
Force deploy without requiring any confirmation for aborting any conflicting processes. |
|
Do not start application after deployment. |
|
Use namespaces in application (and service) names during application deployment. |
|
Do not use namespaces in service names. |
|
Re-create changed services and delete discontinued services. |
|
Delete the existing service keys and apply the new ones. |
|
Delete discontinued service brokers. |
|
Keep the files used for deployment. |
|
Do not restart subscribed applications that are updated during the deployment. |
|
Use this option to turn off the manual confirmation for deleting the older version of the MTA applications. Thus the deployment process is performed from start to finish uninterrupted, and you are not prompted to confirm the switch of routes to the new version of the MTA applications. |
|
Perform the deployment, even if required administrator permissions are missing for some operations (for example, the creation of service brokers). |
|
If an operation fails, the corresponding process is automatically aborted and cannot be retried using the option -a retry. |
|
Deploy only the module with the specified name.
|
|
Deploy all modules.
|
|
Deploy only the resource with the specified name.
|
|
Deploy all resources.
|
--skip-idle-start
|
You can choose to skip the starting of the newly deployed applications on idle routes. This means that the newly deployed applications will be mapped directly to live routes. Under the hood this option includes --no-confirm. |
- If any of the options
-m
,--all-modules
,-r
,--all-resource
is used, only the specified modules and resources will be deployed. Otherwise, everything will be deployed by default.- If the options for the module deploying (
-m
,--all-modules
) are used, the modules need to contain apath
element on an MTA module level, which points to the content of the module. In case the module has somerequires
dependency section to a resource that needs a configuration file, then therequires
section should have apath
parameter, which points to the configuration file.- If the options for the resource deploying (
-r
,--all-resource
) are used, then any resources that have some configuration files need to contain apath
parameter in their parameters section, which points to the configuration file.- The
path
element or parameter value should be relative to the MTA directory.See the complete procedure in section Legacy Blue-Green Deployment.
An example of an MTA deployment descriptor, containing all variants of the
path
elements and parameters can be found at Defining Multitarget Application Deployment Descriptors for Cloud Foundry.
Undeploy a Multitarget Application (MTA), or interact with an undeploy MTA operation.
Undeploy an MTA.
cf undeploy <MTA_ID>
[-u <URL>] [-f]
[--delete-services] [--delete-service-keys] [--delete-service-brokers] [--no-restart-subscribed-apps]
[--do-not-fail-on-missing-permissions]
cf deploy ...[--retries <RETRIES>]
Interact with an undeploy MTA operation, for example, by performing an action.
cf undeploy [-i <UNDEPLOY_ID>] [-a <ACTION>]
Command Arguments Overview
Argument |
Description |
---|---|
<MTA_ID> |
The ID of the MTA you want to undeploy |
<--retries> |
Retry the operation specified number of times in case a non-content error (default 3). |
Command Options Overview
Option |
Description |
---|---|
|
Specify the URL for the service end-point that is to be used for the undeployment operation. |
|
Specify the ID of the undeploy operation that you want to perform an action on. |
|
Specify the action to perform on the undeploy operation, for example, “abort”, “retry”, or “monitor”. |
|
Force completion of the undeploy operation without any system prompt or confirmation. |
|
Delete any related services. |
|
Delete discontinued service brokers. |
|
Do not restart subscribed applications that are updated during the deployment. |
|
Perform the deployment, even if required administrator permissions are missing for some operations (for example, the creation of service brokers). |
|
If an operation fails, the corresponding process is automatically aborted and cannot be retried using the option -a retry. However, if you run a new operation for the same MTA, you will not receive an error message that there is an ongoing process for the MTA and ask you if you want to abort it. |
|
Delete the existing service keys. |
Display information about a Multitarget Application (MTA). The information displayed includes the requested state, the number of instances, information about allocated memory and disk space, as well as details regarding the bound service (and service plan).
cf mta MTA_ID
[-u <URL>]
Command Arguments Overview
Argument |
Description |
---|---|
<MTA_ID> |
The ID of the MTA whose details you want to display |
Command Options Overview
Option |
Description |
---|---|
|
Specify the URL for the deployment-service end-point to use to obtain details of the selected MTA. |
Display information about all available Multitarget Applications (MTA).
cf mtas [-u <URL>]
Command Options Overview
Option |
Description |
---|---|
|
Specify the URL for the deployment-service endpoint to use to obtain details of the selected MTA. |
Display information about all active operations for Multitarget Applications (MTA). The information includes the ID, type, status, the time the MTA-related operation started, as well as the name of the user that started the operation.
cf mta-ops [--mta <MTA>] [-u <URL>] [--last <NUM>] [--all]
Command Options Overview
Option |
Description |
---|---|
|
Specify the URL for the deployment-service end-point to use to obtain details of the selected MTA operations. |
|
List the last <NUM> active MTA operations. |
|
List all active MTA operations. |
|
Specify the MTA whose operations you want to list. |
Download the log files for one or more operations concerning Multitarget Applications.
You have the following usage options:
cf download-mta-op-logs -i <OPERATION_ID> [-u ] [-d ]
- ```
cf download-mta-op-logs --mta <MTA> [ --last <NUM>] [ -u <URL>] [ -d <DIRECTORY>]
You can use the alias
dmol
in place of thedownload-mta-op-logs
command.
Command Options Overview
Option |
Description |
---|---|
|
Specify the URL for the deployment-service end-point to use to obtain details of the selected MTA operations. |
|
Specify the identity (ID) of the MTA operation whose logs you want to download. |
|
Specify the path to the location where you want to save the downloaded MTA operation logs; by default, the location is |
|
Specify the MTA whose logs you want to download.
|
|
Download the last <NUM> logs for the specified MTA. |
Purge all configuration entries and subscriptions, which are no longer valid.
cf purge-mta-config
[-u <URL>]
Invalid configuration entries are often produced when the application that is providing configuration entries is deleted by the user without using the deploy-service, for example, the cf delete
command . In this case, the configuration remains in the deploy-service database even though the corresponding application is no longer available. This could lead to a failure during subsequent attempts to resolve the configuration entries.
Command Options Overview
Option |
Description |
---|---|
|
The URL of the deploy service |
Related Information