Use manifest files
Diese Seite ist noch nicht in deiner Sprache verfügbar. Englische Seite aufrufen
In the following documentation you will learn how to push and update your application with a manifest file.
Using the manifest file for a push
Section titled “Using the manifest file for a push”To make your application configuration in STACKIT Cloud Foundry reproducible, it’s best to manage it as code. You can do this by defining a manifest file—a YAML file that describes your application and, if needed, additional data services.
Create a manifest.yml file for your application and store it in the root of your application’s code. When pushing your application via the Cloud Foundry CLI, the CLI will automatically scan for a manifest.yml and use this configuration to set up your application in STACKIT Cloud Foundry. You can also override the settings in your manifest.yml by specifying their values directly as arguments in the cf push command.
A manifest.yml usually looks like this:
---applications:- name: spring-music memory: 1G random-route: true path: build/libs/spring-music-1.0.jar env: JBP_CONFIG_SPRING_AUTO_RECONFIGURATION: '{enabled: false}' SPRING_PROFILES_ACTIVE: http2# JBP_CONFIG_OPEN_JDK_JRE: '{ jre: { version: 11.+ } }'This example defines an application with the following arguments:
name: The application’s name (used as its identifier).memory: The memory limit for the app.random-route: Adds a random string to the route to avoid conflicts.path: The location of the app artifact to deploy.env: Environment variables to set for the app.
You can add more options as needed for your specific use case.
You can also use variables in your manifest.yml to make your configuration more flexible. For example, you can define your application like this:
---applications:- name: test-app instances: ((instances)) memory: ((memory)) buildpacks: - go_buildpack env: GOPACKAGENAME: go_calls_ruby command: go_calls_rubyIn this manifest, the values for instances and memory are not hardcoded, but referenced as variables. You provide these values in a separate vars.yml file:
instances: 2memory: 1GTo have Cloud Foundry substitute these variables when deploying, you must explicitly reference your vars.yml file with the --vars-file option:
cf push --vars-file /PATH/vars.ymlThis command tells Cloud Foundry to use your manifest and fill in the variable values from the specified vars.yml file.
You should run cf push from the directory containing your manifest.yml, or specify its path with the -f option if it’s located elsewhere:
cf push -f /PATH/manifest.yml --vars-file /PATH/vars.ymlThe manifest.yml file supports many more options and advanced features beyond what we’ve covered here. To explore all available attributes and take full advantage of what manifests can do, check out the app manifest attribute reference in the official Cloud Foundry documentation.