Pushes a project to Cloud Foundry or a CF-based platform (e.g. Stackato) at the end of a build.
You will find the plugin in the list of post-build actions in your
build's configuration page.
(Note: as of version 2.1, the plugin is also available as a build step)
Enter your target URL and your credentials, then test your connection to make sure you won't have problems during the build. Check the "Allow self-signed certificate" if you're using a Stackato micro cloud, or any other PaaS without signed SSL certificates.
If your application already has a manifest.yml in its root directory, you can leave the “Read app info from manifest.yml” checked. Unchecking it will reveal additional settings that you will need to fill out.
That’s it! Start a new build, and your application will be pushed at the end of it.
You can specify services that will be bound to your app, either in the
manifest file or in the Jenkins config. However, this only binds
existing services, it does not create them.
You can either create the services beforehand manually, or use the "Create services before pushing" option.
The plugin will push applications through the proxy used by Jenkins. You can change these settings in Manage Plugins → Advanced → Proxy configuration.
You can use Token
Macros in any
configuration field that accepts a string. This allows you to use
variables as well as any
token generated by other plugins, such as the Git
For example, you can set your application name to:
Declarative Pipeline (minimal configuration)
pushToCloudFoundry( target: 'api.local.pcfdev.io', organization: 'pcfdev-org', cloudSpace: 'pcfdev-space', credentialsId: 'pcfdev_user' )
Minimal configuration with explicit manifest file
pushToCloudFoundry( target: 'api.local.pcfdev.io', organization: 'pcfdev-org', cloudSpace: 'pcfdev-space', credentialsId: 'pcfdev_user', manifestChoice: [manifestFile: 'path/to/manifest.yml'] )
Inline manifest with service creation and binding
pushToCloudFoundry( target: 'api.local.pcfdev.io', organization: 'pcfdev-org', cloudSpace: 'pcfdev-space', credentialsId: 'pcfdev_user', selfSigned: true, servicesToCreate: [ [name: 'mysql-spring', type: 'p-mysql', plan: '512', resetService: true] ], manifestChoice: [ value: 'jenkinsConfig', appName: 'hello-spring-mysql', memory: 512, instances: 2, services: ['mysql-spring'], envVars: [ [key: 'FOO', value: 'bar'] ], appPath: 'test-apps/hello-spring-mysql/target/hello-spring-mysql.war' ] )
- Fixes JENKINS-31208 - Getting issue details... STATUS Support variable expansion in token macros.
CF Java Client dependency upgraded to 2.2.0.RELEASE
Fixes JENKINS-46049 - Getting issue details... STATUS
- Bugfix for communicating to CloudFoundry API endpoints over plain http (see 2.1 release notes)
- Can also specify port (use
- Re-enabled support for Cloudfoundry over unsecure http
http://cloudfoundry.api.targetinstead of just
- Cloudfoundry push is now available as a build step in addition to the post-build action
- The build step is also available as a pipeline step
- The plugin is now based on cf-java-client 2.
- Minimum Java version raised to 1.8 (due to lambdas)
- Pushes are implemented by
org.cloudfoundry.operations.applications.Applications.pushManifest. This should hopefully ensure the behaviour is as close as possible to calling
cf pushvia the CLI
- As a result of using the cf push approach,
Reset app if already existssetting is now a no-op.
- Now uses the plugin-first classloader instead of shaded cf-java-client jar
- Requires accessing the cloudfoundry api over https. Ignoring ssl validation errors is still an option, but plain http is not.
- Add plugin timeout parameter. This lets you set the timeout before the plugin marks the build a failure, independently from the target. This is similar to the "client timeout" option of the cf client.
- Updating the environment variables of an existing app will no longer overwrite existing variables. This is the behavior of the cf client.
- Fix temporary directory not being deleted.
- Fix exception when using a memory value without a unit.
- Add support for more memory units (All units from the CF documentation).
- Ignore unknown macro token in environment variables, to allow dollar signs without escaping.
- Add support for pushing an app with a non-default stack.
- Fix ClassCastException on push in some cases.
- Fix "Could not read JSON" error hiding the true error coming from the target.
- Fix backwards compatibility with the saved configuration of older versions.
- Fix temporary files not being correctly deleted at the end of a push.
- Add an option to create services before the push of the application.
- The default domain for application URIs is now queried from the target, instead of calculated from its URL.
- Fix `WsContainerProvider not a subtype` crash that would happen on some Jenkins instances.
- Fix the ArrayIndexOutOfBoundsException that happened using older versions of Java.
- Add additional stack trace info in case of unknown or CF exception.
- Internal changes.
- Add support for Token Macros in configuration fields that accept a string.
- The behavior of the `no-route` option has been changed in accordance to Cloud Foundry docs. It will now unbind every route attached to the app.
- The `path` option of a manifest file will now be relative to the location of the manifest file. (This is important when using a custom manifest file location)
- Add support for pushing an app through a proxy.
- The plugin now uses credentials from the Credentials Plugin instead of text fields.
- Support for custom manifest file location.
- Add support for distributed jobs.
- Add support for multi-apps manifest.yml files. (They will be pushed in order, but the entire build will be marked as failed if one app fails)
- Fix UI bug where services configured would not show up on reload.
- Print more useful info in case of unknown CloudFoundryException.
- Initial release.