Deploying with App Manifests

This topic provides basic procedures and guidance for deploying apps with a manifest file.

Overview

Manifests provide consistency and reproducibility, and can help you automate deploying apps. Both manifests and command line options allow you to override the default attribute values of cf push. These attributes include things like number of instances, disk space limit, and memory limit.

cf push follows rules of precedence when setting attribute values:

  • Manifests override most recent values, including defaults and values set by commands such as cf scale.
  • Command line options override manifests.

For a full list of attributes you can specify in an app manifest, see App Manifest Attribute Reference.

Deploy an App with a Manifest

The following procedure describes how to deploy an app with a minimal manifest. For more information about manifest format and attributes, see App Manifest Attribute Reference.

To deploy an app with a manifest, do the following:

  1. Create a manifest.yml file in the root directory of your app.

    Note: By default, the cf push command looks for a manifest file in the app directory. However, you can create a manifest file in a different location and use the -f flag when you run cf push

  2. Add the following content to the file, replacing MY-APP with the name of your app:

    ---
    applications:
    - name: MY-APP
    
  3. Run cf push. If you specify any command line options, they override the values specified in the manifest. See the following section.

Deploy Multiple Apps with One Manifest

This procedure describes how to deploy multiple apps with a minimal manifest. For more information about manifest format and attributes, see App Manifest Attribute Reference.

General Rules

Follow these general rules when deploying multiple apps with one manifest:

  • Use a no-route line in the description of any app that provides background services to another app.

  • You cannot use any command line options with cf push except for -f and --no-start.

    • If your manifest is not named manifest.yml or not in the current working directory, use the -f command line option.
  • To push a single app rather than all of the apps described in the manifest, provide the desired app name by running cf push my-app.

Procedure

To deploy multiple apps with a manifest, do the following:

Note: Each app must be in a subdirectory under the same parent directory.

  1. Create a manifest.yml file in the directory that contains the apps.

  2. Add each app and its directory to the file. CF pushes the apps in the order specified in the manifest.

    Note: If you push multiple apps using a manifest and one fails to deploy, CF does not attempt to push apps specified after the app that failed.

    ---
    applications:
    - name: APP-ONE
      path: ./APP-ONE-DIRECTORY
    - name: APP-TWO
      path: ./APP-TWO-DIRECTORY
    

    Where:

    • APP-ONE is the name of the first app you want CF to push
    • APP-ONE-DIRECTORY is the directory containing the first app
    • APP-TWO is the name of the second app you want CF to push
    • APP-TWO-DIRECTORY is the directory containing the second app
  3. Run cf push from the directory that contains the apps and the manifest.