Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Skip App Deployment Example (skip-deploy)

This example demonstrates how to use the skip-deploy: true/false parameter at the module level in an MTA descriptor (mta.yaml).

Scenario

You may want to include modules or resources in your MTA that should not always be deployed. The skip-deploy parameter allows you to control deployment per module, while the active attribute allows you to control deployment per resource:

  • skip-deploy: true — The module will be skipped during deployment.

  • skip-deploy: false — The module will be deployed as usual.

The functionalities for skipping modules and resources are similar: use skip-deploy for modules and active for resources to conditionally include or exclude them during deployment.

Example

...
modules:
  - name: app-to-deploy
    type: application
    path: appBits.zip
    parameters:
      skip-deploy: false # This is the default value, can be omitted
  - name: app-to-skip
    type: application
    path: appBits.zip
    parameters:
      skip-deploy: true

In this example, only app-to-deploy will be deployed. app-to-skip will be ignored by the deployment process.

Build and Deploy Steps

To build and deploy this MTA example, use the following commands:

  1. Build the MTA archive (requires Cloud MTA Build Tool):

    mbt build

    This will generate an .mtar file in the mta_archives directory.

  2. Deploy the MTA archive to Cloud Foundry (requires MultiApps CF CLI Plugin):

    cf deploy mta_archives/<your-mta-archive>.mtar

    Replace <your-mta-archive> with the actual file name generated by the build step.

Examine the result

List the deployed MTA application

$ cf mta skip-app-deploy
Showing health and status for multi-target app skip-app-deploy-example in org ********** / space ******** as **********...
OK
Version: 0.0.1
Namespace:

Apps:
name            requested state   instances   memory   disk   urls
app-to-deploy   STARTED           1/1         19.4M    5.3M   orgname-spacename-app-to-deploy.example.com

Services:

Validate that only the app-to-deploy is listed as started, while app-to-skip is not deployed.

Skipping Module Deployment via Extension Descriptor

You can also skip deployment of a module by setting skip-deploy: true in an extension descriptor (.mtaext). This is useful for environment-specific deployments.

Example extension descriptor (skip-app.mtaext)
_schema-version: '3.1'
ID: skip-app-deploy-ext
extends: skip-app-deploy-example
version: 0.0.1

modules:
  - name: app-to-deploy
    parameters:
      skip-deploy: true
  - name: app-to-skip
    parameters:
      skip-deploy: false

To use the extension descriptor during deployment:

cf deploy mta_archives/<your-mta-archive>.mtar -e skip-app.mtaext

This will skip deployment of app-to-deploy and deploy app-to-skip as specified in the extension descriptor.

See skip-app.mtaext in this directory for the real file example.

When to use

  • For conditional deployments

  • For development/test scenarios

  • To keep modules in the descriptor but exclude them from certain deployments

  • When partial build/deploy is not usable (see the partial-build-deploy example in this project) for example transport scenarios with Cloud Transport Management Service, where partial deploy is not an option. In these cases, skip-deploy provides fine-grained control over which modules are deployed.