> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# circleci/cloudfoundry

Push and deploy applications to Cloud Foundry


## Commands

### auth

Authenticates with a CloudFoundry host.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `endpoint` | string | https://api.run.pivotal.io | The domain of the Cloud Foundry runtime API endpoint. Defaults to https://api.run.pivotal.io |
| `org` | string |  | Cloud Foundry org to target |
| `space` | string |  | Cloud Foundry space to target |

### dark_deploy

| Parameter | Type | Default | Description |
|---|---|---|---|
| `appname` | string |  | App Name |
| `dark_subdomain` | string | dark | Cloud Foundry dark domain to prefix domain (i.e. <dark_subdomain>.<domain>, defaults to "dark") |
| `domain` | string |  | Cloud Foundry domain registered to handle routes for this space (a "dark" or "live" sub-domain will be used in conjunction with this, i.e. <dark_subdomain>.<domain>) |
| `manifest` | string |  | The Cloud Foundry manifest for this environment |
| `package` | string |  | path to the asset/package to push |
| `vars` | string |  | Vars file for variable substitution. |

### install

Installs and authenticates with the latest CLI version if not present.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `platform` | enum | linux | The platform to install CloudFoundry on - macosx, linux or windows. |
| `version` | enum | 6 | Version of CloudFoundry CLI to install. |

### live_deploy

| Parameter | Type | Default | Description |
|---|---|---|---|
| `appname` | string |  | App Name |
| `domain` | string |  | Cloud Foundry domain (a "dark" sub-domain will be used on this.) |
| `live_subdomain` | string | www | Cloud Foundry live subdomain to prefix domain (i.e. <live_subdomain>.<domain>, defaults to "wwww") |

### push

Push and stard a Cloud Foundry application.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `appname` | string |  | App Name |
| `manifest` | string |  | The Cloud Foundry manifest for this environment |
| `package` | string |  | path to the asset/package to push |
| `path` | string | . | Directory or zip file containing your application. |
| `vars` | string |  | Vars file for variable substitution. |

## Jobs

### blue_green

Execute a blue/green deploy  in a single job. Expects either build_steps or workspace_path for assets to deploy.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `appname` | string |  | App Name |
| `build_steps` | steps |  | Steps to generate application package or files. Alternately provide `workspace_path`
 |
| `dark_subdomain` | string | dark | Cloud Foundry dark domain to prefix domain (i.e. <dark_subdomain>.<domain>, defaults to "dark")
 |
| `domain` | string |  | Cloud Foundry domain registered to handle routes for this space (a "dark" or "live" sub-domain will be used in conjunction with this, i.e. <dark_subdomain>.<domain>)
 |
| `endpoint` | string | https://api.run.pivotal.io | The domain of the Cloud Foundry runtime API endpoint. Defaults to https://api.run.pivotal.io
 |
| `image` | string | cimg/base:stable | Docker image in which to run commands. |
| `live_subdomain` | string | www | Cloud Foundry live subdomain to prefix domain (i.e. <live_subdomain>.<domain>, defaults to "www")
 |
| `manifest` | string |  | The Cloud Foundry manifest for this environment |
| `org` | string |  | Cloud Foundry Org to target |
| `package` | string |  | path to the asset/package to push |
| `space` | string |  | Cloud Foundry space to target |
| `validate_steps` | steps |  | Optional steps to run between the dark and live deployments. |
| `vars` | string |  | Vars file for variable substitution. |
| `workspace_path` | string |  | The key of a workflow workspace which contains artifact. Alternately provide `build_steps`
 |

### dark_deploy

Execute a dark (blue) deploy  in a single job. Expects either build_steps or workspace_path for assets to deploy.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `appname` | string |  | App Name |
| `build_steps` | steps |  | Steps to generate artifacts. Alternately provide `workspace_path` |
| `dark_subdomain` | string | dark | Cloud Foundry dark domain to prefix domain (i.e. <dark_subdomain>.<domain>, defaults to "dark")
 |
| `domain` | string |  | Cloud Foundry domain registered to handle routes for this space (a "dark" or "live" sub-domain will be used in conjunction with this, i.e. <dark_subdomain>.<domain>)
 |
| `endpoint` | string | https://api.run.pivotal.io | The domain of the Cloud Foundry runtime API endpoint. Defaults to https://api.run.pivotal.io
 |
| `image` | string | cimg/base:stable | Docker image in which to run commands. |
| `manifest` | string |  | The Cloud Foundry manifest for this environment |
| `org` | string |  | Cloud Foundry Org to target |
| `package` | string |  | path to the asset/package to push |
| `space` | string |  | Cloud Foundry space to target |
| `validate_steps` | steps |  | Optional steps to run between the dark and live deployments. |
| `vars` | string |  | Vars file for variable substitution. |
| `workspace_path` | string |  | The key of a workflow workspace which contains artifact. Alternately provide `build_steps`
 |

### live_deploy

Execute final URL remap and application name cleanup.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `appname` | string |  | App Name |
| `domain` | string |  | Cloud Foundry domain registered to handle routes for this space (a "dark" or "live" sub-domain will be used in conjunction with this, i.e. <live_subdomain>.<domain>)
 |
| `endpoint` | string | https://api.run.pivotal.io | The domain of the Cloud FOundry runtime API endpoint. Defaults to https://api.run.pivotal.io
 |
| `image` | string | cimg/base:stable | Docker image in which to run commands. |
| `live_subdomain` | string | www | Cloud Foundry dark domain to prefix domain (i.e. <live_subdomain>.<domain>, defaults to "www")
 |
| `org` | string |  | Cloud Foundry Org to target |
| `space` | string |  | Cloud Foundry space to target |
| `validate_steps` | steps |  | Optional steps to run before remapping URLs. |

### push

Execute a simple push in a single job. Expects either build_steps or workspace_path for assets to deploy.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `appname` | string |  | App Name |
| `build_steps` | steps |  | Steps to generate application package or files. Alternately provide `workspace_path`
 |
| `endpoint` | string | https://api.run.pivotal.io | The domain of the Cloud Foundry runtime API endpoint. Defaults to https://api.run.pivotal.io
 |
| `image` | string | cimg/base:stable | Docker image in which to run commands. |
| `manifest` | string |  | The Cloud Foundry manifest for this environment |
| `org` | string |  | Cloud Foundry 'Org' to target |
| `package` | string |  | path to the package/files to push if not the current directory |
| `space` | string |  | Cloud Foundry 'Space' to target |
| `vars` | string |  | Vars file for variable substitution. |
| `workspace_path` | string |  | The key of a workflow workspace which contains artifact. Alternately provide `build_steps`
 |

## Examples

### blue_green_deploy

A blue-green deployment

```yaml
version: '2.1'
orbs:
  cloudfoundry: circleci/cloudfoundry@x.y
workflows:
  build_deploy:
    jobs:
      - cloudfoundry/blue_green:
          appname: your-app
          build_steps:
            - run: echo 'your build steps'
            - run: echo 'you can have more, too'
          context: your-context
          domain: your-domain
          org: your-org
          space: your-space
          validate_steps:
            - run: echo 'your validation steps'
            - run: echo 'you can also have more of these'
```

### build_and_push

Build and deploy your application in a single job.

```yaml
version: '2.1'
orbs:
  cloudfoundry: circleci/cloudfoundry@x.y
workflows:
  build-deploy:
    jobs:
      - cloudfoundry/push:
          appname: your-app
          build_steps:
            - run: echo 'your build steps'
            - run: echo 'you can have more, too'
          org: your-org
          space: your-space
```