Search

Deploy to Cloud

Deploy to Cloud Using MTA

Build the Application

For clean, production-like builds and deployments, we deploy our application as Multitarget Application (MTA). The MTA build tool can create such a self-contained MTA archive, packaging the different parts of the application (DB, service, and UI) into one ZIP file. The mta.yaml deployment descriptor contains all metadata that helps create and bind relevant backing services (like SAP HANA or UAA). For our application, this descriptor was incrementally created by the cds new calls from above, so that we don’t need to touch it.

To build the actual archive, do the following:

  1. Download the MTA build tool (a .jar file, see section Multi-Target Application Archive Builder on the linked help page).
  2. In the application root directory, execute:
    java -jar <path to mta tool jar> --build-target=CF build
    

    This creates a bookshop.mtar file.

    Got errors? See the troubleshooting guide.

Log In to Cloud Foundry

To connect to Cloud Foundry

  1. Download and install the cf command-line client for Cloud Foundry.
  2. Log on to Cloud Foundry
    cf login  # this will ask you to select CF API, org, and space
    

    Don’t know which CF org and space to use? See the troubleshooting guide.

Deploy to Cloud Foundry

Install the MTA deployer plugin, which adds the cf deploy command for MTA archives.

  1. Download and install the MTA deployer plugin (find MTA Plugin)
  2. Execute
    chmod +x cf-cli-mta-plugin-...bin # on Mac and Linux only
    cf install-plugin cf-cli-mta-plugin-...bin
    

Deploy the application:

  1. Check with cf target that you use the intended CF org and space.
  2. Start the deployment
    cf deploy bookshop.mtar
    

    This takes some minutes. After successful execution you should see the individual applications deployed, along with the relevant service bindings:

    cf apps
    

    Got errors? See the troubleshooting guide.