Skip to content

Repository files navigation

cf cli Concourse Resource

An output only resource capable of running lots of Cloud Foundry cli commands.

Status
buildbuild
v6 testsv6 tests
v7 testsv7 tests
v8 testsv8 tests
image scanimage scan
dockerDocker Pulls

Source Configuration

Base configuration parameters:

ParamsUsageDescription
apiRequiredThe address of the Cloud Controller in the Cloud Foundry deployment.
skip_cert_checkOptionalCheck the validity of the CF SSL cert. Defaults to false.
orgOptionalSets the default organization to target (can be overridden in the params config).
spaceOptionalSets the default space to target (can be overridden in the params config).
cf_colorOptionalSet to false to not colorize cf output (can be overridden in the params config).
cf_dial_timeoutOptionalMax wait time to establish a connection, including name resolution, in seconds (can be overridden in the params config).
cf_traceOptionalSet to true to print cf API request diagnostics to stdout (can be overridden in the params config).

Supported cf cli versions:

ParamsUsageDescription
cf_cli_versionOptionalThe major version of the cf cli to use. Supported values: 6, 7, 8 (defaults to 6)

Authentication is supported by either using username and password:

ParamsUsageDescription
usernameRequiredThe username used to authenticate.
passwordRequiredThe password used to authenticate.
originOptionalThe identity provider to be used for authentication

...or using client_id and client_secret:

ParamsUsageDescription
client_idRequiredThe client id used to authenticate.
client_secretRequiredThe client secret used to authenticate.
resource_types:
- name: cf-cli-resourcetype: registry-imagesource:
repository: nulldriver/cf-cli-resourcetag: latestresources:
- name: cloud-foundrytype: cf-cli-resourcesource:
api: https://api.example.comusername: name@example.compassword: my passwordcf_cli_version: 8

Multiple Command Syntax

This resource is capable of running single commands in separate put steps:

- put: cloud-foundryparams:
command: create-orgorg: myorg
- put: cloud-foundryparams:
command: create-spaceorg: myorgspace: myspace

or they can be combined in a single put step:

- put: cloud-foundryparams:
commands:
- command: create-orgorg: myorg
- command: create-spaceorg: myorgspace: myspace

And, of course, if you have your org and space defined in the source config, it gets even more concise:

- put: cloud-foundryparams:
commands:
- command: create-org
- command: create-space

CF_HOME

The standard way to authenticate the cf-cli-resource with a target Cloud Foundry environment is to either use usernameandpasswordorclient_idandclient_secret, which will save a $CF_HOME/.cf/config.json file containing the API endpoint, and access token. For some pipeline workflows, it is necessary to authenticate using alternative methods and then supply the pre-configured config.json to the cf-cli-resource.

See examples/cf_home-auth/pipeline.yml for a full example

resources:
- name: cloud-foundrytype: cf-cli-resourcejobs:
- name: deployplan:
- get: my-repo
- task: authenticatefile: my-repo/some-script-that-authenticates-and-creates-a-cf-config-json.yml
- put: cloud-foundryparams:
cf_home: authenticate-task-outputcommands:
- command: pushpath: my-repo/myappmanifest: my-repo/manifest.yml

Command via file input

This resource supports file inputs. This allows the pipeline to parameterize and generate commands during pipeline execution.

ParamsUsageCLI VersionDescription
command_fileOptionalAllContains path to a YAML file that contains the same fields as params; including command or commands. If used, this resource uses only the configuration listed in this file. All other configurations specified in the params section will be ignored. The command_file field (if exists) is ignored within the content of the file itself.
- task: configureconfig:
platform: linuximage_resource:
type: docker-imagesource:
repository: ubunturun:
path: bashargs:
- -excl
- |- cat > cf_command/params.yml <<EOF command: delete app_name: myapp delete_mapped_routes: true EOFoutputs:
- name: cf_command
- put: cloud-foundryparams:
command: deletecommand_file: cf_command/params.yml

Commands

create-org

Create an org

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to create (Optional if set in the source config)
- put: cloud-foundryparams:
command: create-orgorg: myorg

delete-org

Delete an org

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to delete (Optional if set in the source config)
- put: cloud-foundryparams:
command: delete-orgorg: myorg

create-space

Create a space

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to create (Optional if set in the source config)
- put: cloud-foundryparams:
command: create-spaceorg: myorgspace: myspace

delete-space

Delete a space

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to delete (Optional if set in the source config)
- put: cloud-foundryparams:
command: delete-spaceorg: myorgspace: myspace

allow-space-ssh

Allow SSH access for the space

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to allow SSH access (Optional if set in the source config)
- put: cloud-foundryparams:
command: allow-space-sshorg: myorgspace: myspace

disallow-space-ssh

Disallow SSH access for the space

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to disallow SSH access (Optional if set in the source config)
- put: cloud-foundryparams:
command: disallow-space-sshorg: myorgspace: myspace

create-private-domain

Create a private domain for a specific org

Alias: create-domain

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
domainRequiredAllThe domain to add to the organization
- put: cloud-foundryparams:
command: create-private-domainorg: myorgdomain: example.com

delete-private-domain

Delete a private domain

Alias: delete-domain

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
domainRequiredAllThe domain to delete
- put: cloud-foundryparams:
command: delete-private-domaindomain: example.com

create-shared-domain

Create a domain that can be used by all orgs (admin-only)

ParamsUsageCLI VersionDescription
domainRequiredAllThe shared domain to create
internalOptionalAll(boolean) Applications that use internal routes communicate directly on the container network
- put: cloud-foundryparams:
command: create-shared-domaindomain: example.com

delete-shared-domain

Delete a shared domain

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
domainRequiredAllThe shared domain to create
- put: cloud-foundryparams:
command: delete-shared-domainorg: myorgdomain: example.com

create-route

Create a route for later use

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
other_spaceOptional6The space for the route (Defaults to space)
domainRequiredAllDomain for the HTTP route
hostnameOptionalAllHostname for the HTTP route (required for shared domains)
pathOptionalAllPath for the HTTP route
- put: cloud-foundryparams:
command: create-routedomain: example.comhostname: myhostpath: foo

map-route

Map a route to an app

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
app_nameRequiredAllThe application to map the route to
domainRequiredAllThe domain to map to the application
hostnameOptionalAllHostname for the HTTP route (required for shared domains)
pathOptionalAllPath for the HTTP route
app_protocolOptional8[Beta flag, subject to change] Protocol for the route destination (default: http1). Only applied to HTTP routes
- put: cloud-foundryparams:
command: map-routeapp_name: myappdomain: example.comhostname: myhostpath: foo

unmap-route

Remove a route from an app

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
app_nameRequiredAllThe application to map the route to
domainRequiredAllThe domain to unmap from the application
hostnameOptionalAllHostname used to identify the HTTP route
pathOptionalAllPath used to identify the HTTP route
- put: cloud-foundryparams:
command: unmap-routeapp_name: myappdomain: example.comhostname: myhostpath: foo

delete-route

Delete a route

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
domainRequiredAllDomain used to identify the HTTP route
hostnameOptionalAllHostname used to identify the HTTP route
pathOptionalAllPath used to identify the HTTP route
- put: cloud-foundryparams:
command: delete-routedomain: example.comhostname: myhostpath: foo

create-user

Create a new user

ParamsUsageCLI VersionDescription
usernameRequiredAllThe user to create
passwordOptionalAllThe password (must specify either password or origin)
originOptionalAllThe authentication origin (e.g. ldap, provider-alias) (must specify either password or origin)

Create a user with credentials:

- put: cloud-foundryparams:
command: create-userusername: j.smith@example.compassword: S3cr3t

Create an LDAP user:

- put: cloud-foundryparams:
command: create-userusername: j.smith@example.comorigin: ldap

create-users-from-file

Bulk create users from a csv file

ParamsUsageCLI VersionDescription
fileRequiredAllThe csv file containing the users
- put: cloud-foundryparams:
command: create-users-from-filefile: somepath/users.csv

The format of the bulk load file:

UsernamePasswordOrgSpaceOrgManagerBillingManagerOrgAuditorSpaceManagerSpaceDeveloperSpaceAuditor
user1S3cr3torg1devxxxxxx
user2org2devxxxx
user3S3cr3torg3devxx
user3S3cr3torg3testxx

Notes:

  • The file must include the header row
  • The file must be in comma separated value format
  • You can specify the user more than once to assign multiple orgs/spaces
  • If you omit the Org, no org or space roles will be assigned
  • If you omit the Space, no space roles will be assigned

delete-user

Delete a user

ParamsUsageCLI VersionDescription
usernameRequiredAllThe user to delete
originOptional7, 8Origin for mapping a user account to a user in an external identity provider
- put: cloud-foundryparams:
command: delete-userusername: j.smith@example.com

create-user-provided-service

Make a user-provided service instance available to CF apps

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
service_instanceRequiredAllThe name to give the service instance
credentialsOptionalAllCredentials, provided as YAML, inline json or in a file, to be exposed in the VCAP_SERVICES environment variable for bound applications
syslog_drain_urlOptionalAllURL to which logs for bound applications will be streamed
route_service_urlOptionalAllURL to which requests for bound routes will be forwarded. Scheme for this URL must be https
- put: cloud-foundryparams:
commands:
# credentials as YAML
- command: create-user-provided-serviceservice_instance: my-db-minecredentials:
username: adminpassword: pa55woRD# credentials as inline json
- command: create-user-provided-serviceservice_instance: my-db-minecredentials: '{"username":"admin","password":"pa55woRD"}'# credentials as json file
- command: create-user-provided-serviceservice_instance: another-db-minecredentials: path/to/credentials.json# syslog drain url
- command: create-user-provided-serviceservice_instance: my-drain-servicesyslog_drain_url: syslog://example.com# route service url
- command: create-user-provided-serviceservice_instance: my-route-serviceroute_service_url: https://example.com

create-service

Create a service instance

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
serviceRequiredAllThe marketplace service name to create
planRequiredAllThe service plan name to create
service_instanceRequiredAllThe name to give the service instance
brokerOptionalAllCreate a service instance from a particular broker. Required when service name is ambiguous
configurationOptionalAllValid JSON object containing service-specific configuration parameters, provided either in-line or in a file. For a list of supported configuration parameters, see documentation for the particular service offering.
tagsOptionalAllUser provided tags
waitOptionalAllWait for the operation to complete
timeoutOptional6, 7Max wait time for service creation, in seconds. Defaults to 600 (10 minutes) (use with wait param)
update_serviceOptionalAllUpdate service instance if it already exists. Defaults to false.
- put: cloud-foundryparams:
command: create-serviceservice: p-config-serverplan: standardservice_instance: my-config-serverconfiguration: '{"count":1}'tags: "list, of, tags"wait: trueupdate_service: true

update-service

Update a service instance

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
service_instanceRequiredAllThe name of the service instance
planRequiredAllChange service plan for a service instance
configurationOptionalAllValid JSON object containing service-specific configuration parameters, provided either in-line or in a file. For a list of supported configuration parameters, see documentation for the particular service offering.
tagsOptionalAllUser provided tags
waitOptionalAllWait for the operation to complete
timeoutOptional6, 7Max wait time for service update, in seconds. Defaults to 600 (10 minutes) (use with wait param)
- put: cloud-foundryparams:
command: update-serviceservice: p-config-serverplan: proservice_instance: my-config-serverconfiguration: '{"count":2}'tags: "list, of, tags"wait: true

delete-service

Delete a service instance

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
service_instanceRequiredAllThe service instance to delete
waitOptionalAllWait for the operation to complete
timeoutOptional6, 7Max wait time for service update, in seconds. Defaults to 600 (10 minutes) (use with wait param)
- put: cloud-foundryparams:
command: delete-serviceservice_instance: my-config-serverwait: true

share-service

Share a service instance with another space

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
service_instanceRequiredAllThe name of the service instance to share
other_orgOptionalAllOrg of the other space (Default: targeted org)
other_spaceRequiredAllSpace to share the service instance into
- put: cloud-foundryparams:
command: share-serviceservice_instance: my-shared-serviceother_org: other-orgother_space: other-space

unshare-service

Unshare a shared service instance from a space

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
service_instanceRequiredAllThe name of the service instance to unshare
other_orgOptionalAllOrg of the other space (Default: targeted org)
other_spaceRequiredAllSpace to unshare the service instance from
- put: cloud-foundryparams:
command: unshare-serviceservice_instance: my-shared-serviceother_org: other-orgother_space: other-space

create-service-key

Create key for a service instance

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
service_instanceRequiredAllThe name of the service instance for which the key is to be created
service_keyRequiredAllThe name to give the service key
configurationOptionalAllValid JSON object containing service-specific configuration parameters, provided either in-line or in a file. For a list of supported configuration parameters, see documentation for the particular service offering.
waitOptional8Wait for the operation to complete
- put: cloud-foundryparams:
command: create-service-keyservice_instance: my-dbservice_key: my-db-service-key

delete-service-key

Delete a service key

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
service_instanceRequiredAllThe service instance that has the service key
service_keyRequiredAllThe service key to delete
waitOptional8Wait for the operation to complete
- put: cloud-foundryparams:
command: delete-service-keyservice_instance: my-dbservice_key: my-db-service-key

create-service-broker

Create a service broker

Create or update a service broker. If a service broker already exists, updates the existing service broker.

ParamsUsageCLI VersionDescription
orgOptionalAllThe organization to target (required if space_scoped: true)
spaceOptionalAllThe space to target (required if space_scoped: true)
service_brokerRequiredAllThe service broker name to create
usernameRequiredAllThe service broker username
passwordRequiredAllThe service broker password
urlRequiredAllThe service broker url
space_scopedOptionalAllMake the broker's service plans only visible within the targeted space. Defaults to false.
- put: cloud-foundryparams:
command: create-service-brokerservice_broker: some-serviceusername: adminpassword: passwordurl: http://broker.name.com

delete-service-broker

Delete a service broker

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
service_brokerRequiredAllThe service broker name to delete
- put: cloud-foundryparams:
command: delete-service-brokerservice_broker: some-service

wait-for-service

Wait for a service instance to start

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
service_instanceRequiredAllThe service instance to wait for
timeoutOptionalAllMax wait time for service creation, in seconds. Defaults to 600 (10 minutes)
- put: cloud-foundryparams:
command: wait-for-serviceservice_instance: my-config-servertimeout: 300

enable-service-access

Enable access to a service offering or service plan for one or all orgs

ParamsUsageCLI VersionDescription
serviceRequiredAllThe marketplace service name to enable
brokerOptionalAllEnable access to a service from a particular service broker. Required when service name is ambiguous
access_orgOptionalAllEnable access for a specified organization
planOptionalAllEnable access to a specified service plan
- put: cloud-foundryparams:
command: enable-service-accessservice: some-servicebroker: some-service-brokeraccess_org: myorgplan: simple

disable-service-access

Disable access to a service offering or service plan for one or all orgs

ParamsUsageCLI VersionDescription
serviceRequiredAllThe marketplace service name to disable
access_orgOptionalAllDisable access for a specified organization
planOptionalAllDisable access to a specified service plan
- put: cloud-foundryparams:
command: disable-service-accessservice: some-serviceaccess_org: myorgplan: simple

### bind-service

Bind a service instance to an app

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
app_nameRequiredAllThe application to bind to the service
service_instanceRequiredAllThe service instance to bind to the application
configurationOptionalAllValid JSON object containing service-specific configuration parameters, provided either in-line or in a file. For a list of supported configuration parameters, see documentation for the particular service offering.
binding_nameOptionalAllName to expose service instance to app process with
waitOptional8Wait for the operation to complete
- put: cloud-foundryparams:
command: bind-serviceapp_name: myappservice_instance: mydbconfiguration: '{"permissions":"read-only"}'

unbind-service

Unbind a service instance from an app

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
app_nameRequiredAllThe application to unbind from the service instance
service_instanceRequiredAllThe service instance to unbind from the application
waitOptional8Wait for the operation to complete
- put: cloud-foundryparams:
command: unbind-serviceapp_name: myappservice_instance: mydb

bind-route-service

Bind a service instance to an HTTP route

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
domainRequiredAllThe domain to bind the route to
service_instanceRequiredAllThe service instance to bind the route to
hostnameOptionalAllHostname used in combination with domain to specify the route to bind
pathOptionalAllPath used in combination with hostname and domain to specify the route to bind
configurationOptionalAllValid JSON object containing service-specific configuration parameters, provided either in-line or in a file. For a list of supported configuration parameters, see documentation for the particular service offering.
waitOptional8Wait for the operation to complete
- put: cloud-foundryparams:
command: bind-route-servicedomain: example.comservice_instance: myloggerhostname: myhostpath: fooconfiguration: '{"permissions":"read-only"}'

unbind-route-service

Unbind a service instance from an HTTP route

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
domainRequiredAllThe domain to unbind the route from
service_instanceRequiredAllThe service instance to unbind the route from
hostnameOptionalAllHostname used in combination with domain to specify the route to unbind
pathOptionalAllPath used in combination with hostname and domain to specify the route to unbind
waitOptional8Wait for the operation to complete
- put: cloud-foundryparams:
command: unbind-route-servicedomain: example.comservice_instance: myloggerhostname: myhostpath: foo

enable-feature-flag

Allow use of a feature

ParamsUsageCLI VersionDescription
feature_nameRequiredAllFeature to enable
- put: cloud-foundryparams:
command: enable-feature-flagfeature_name: service_instance_sharing

disable-feature-flag

Prevent use of a feature

ParamsUsageCLI VersionDescription
feature_nameRequiredAllFeature to disable
- put: cloud-foundryparams:
command: disable-feature-flagfeature_name: service_instance_sharing

push

Push a new app or sync changes to an existing app

A manifest can be used to specify values for required parameters. Any parameters specified will override manifest values.

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
app_nameRequiredAllThe name of the application (Optional if using a manifest that specifies the application name)
buildpackOptionalAllDeprecated, please use buildpacks instead.
buildpacksOptionalAllList of custom buildpacks by name (e.g. my-buildpack) or Git URL (e.g. 'https://github.com/cloudfoundry/java-buildpack.git') or Git URL with a branch or tag (e.g. 'https://github.com/cloudfoundry/java-buildpack.git#v3.3.0' for 'v3.3.0' tag). To use built-in buildpacks only, specify default or "null" (note the use of double quotes!)
disk_quotaOptionalAllDisk limit (e.g. 256M, 1024M, 1G)
docker_imageOptionalAllDocker-image to be used (e.g. user/docker-image-name)
docker_usernameOptionalAllThis is used as the username to authenticate against a protected docker registry
docker_passwordOptionalAllThis should be the users password when authenticating against a protected docker registry
domainOptional6Domain to use instead of the default (e.g. apps.internal, subdomain.example.com)
environment_variablesOptionalAllMap of environment variables to pass to application
hostnameOptional6Hostname (e.g. my-subdomain)
instancesOptionalAllNumber of instances
manifestOptionalAllPath to manifest file, or valid application manifest yaml
memoryOptionalAllMemory limit (e.g. 256M, 1024M, 1G)
no_startOptionalAllDo not start an app after pushing. Defaults to false.
pathOptionalAllPath to app directory or to a zip file of the contents of the app directory
stackOptionalAllStack to use (a stack is a pre-built file system, including an operating system, that can run apps)
startup_commandOptionalAllStartup command, set to "null" (note the use of double quotes!) to reset to default start command
strategyOptional7, 8Deployment strategy, either rolling or null (note the absence of double quotes!)
varsOptionalAllMap of variables to pass to manifest
vars_filesOptionalAllList of variables files to pass to manifest
show_app_logOptionalAllOutputs the app log after a failed startup, useful to debug issues when used together with the app_name option.
staging_timeoutOptionalAllMax wait time for buildpack staging, in minutes
startup_timeoutOptionalAllMax wait time for app instance startup, in minutes
- put: cloud-foundryparams:
command: pushapp_name: myappmemory: 1Gpath: path/to/myapp-*.jarbuildpacks:
- java_buildpackmanifest: path/to/manifest.ymlvars:
instances: 3vars_files:
- path/to/vars.ymlenvironment_variables:
key: valuekey2: value2

Example directly specifying the manifest as yaml:

- put: cloud-foundryparams:
command: pushpath: path/to/myapp-*.jarmanifest:
applications:
- name: myappmemory: 1Gbuildpacks:
- java_buildpackenv:
key: valuekey2: value2

zero-downtime-push

Push a new app or sync changes to an existing app using a zero downtime strategy. A manifest that describes the application must be specified.

This command is designed to function as a replacement for the Concourse cf-resource.

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
manifestRequiredAllPath to a application manifest file.
pathOptionalAllPath to the application to push. If this isn't set then it will be read from the manifest instead.
current_app_nameOptionalAllThis should be the name of the application that this will re-deploy over. If this is set the resource will perform a zero-downtime deploy.
environment_variablesOptionalAllEnvironment variable key/value pairs to add to the manifest.
varsOptionalAllMap of variables to pass to manifest
vars_filesOptionalAllList of variables files to pass to manifest
docker_imageOptionalAllDocker-image to be used (e.g. user/docker-image-name)
docker_usernameOptionalAllThis is used as the username to authenticate against a protected docker registry
docker_passwordOptionalAllThis should be the users password when authenticating against a protected docker registry
show_app_logOptionalAllOutputs the app log after a failed startup, useful to debug issues when used together with the current_app_name option.
no_startOptionalAllDeploys the app but does not start it.
stackOptionalAllStack to use (a stack is a pre-built file system, including an operating system, that can run apps)
staging_timeoutOptionalAllMax wait time for buildpack staging, in minutes
startup_timeoutOptionalAllMax wait time for app instance startup, in minutes
- put: cloud-foundryparams:
command: zero-downtime-pushmanifest: path/to/manifest.ymlpath: path/to/myapp-*.jarcurrent_app_name: myappenvironment_variables:
key: valuekey2: value2vars:
instances: 3vars_files:
- path/to/vars.yml

set-env

Set an env variable for an app

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
app_nameRequiredAllThe name of the application
environment_variablesRequiredAllEnvironment variable key/value pairs to set.
- put: cloud-foundryparams:
command: set-envapp_name: myappenvironment_variables:
JBP_CONFIG_OPEN_JDK_JRE: "{ jre: { version: 11.+ }, memory_calculator: { stack_threads: 25 } }"SOME_OTHER_KEY: SOME_OTHER_VALUE

start

Start an app

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
app_nameRequiredAllThe name of the application
staging_timeoutOptionalAllMax wait time for buildpack staging, in minutes
startup_timeoutOptionalAllMax wait time for app instance startup, in minutes
- put: cloud-foundryparams:
command: startapp_name: myapp

stop

Stop an app

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
app_nameRequiredAllThe name of the application
- put: cloud-foundryparams:
command: stopapp_name: myapp

restart

Stop all instances of the app, then start them again.

This command will cause downtime unless you use strategy: rolling.

ParamsUsageCLI VersionDescription
orgOptionalAllThe organization to target (required if not set in the source config)
spaceOptionalAllThe space to target (required if not set in the source config)
app_nameRequiredAllThe name of the application
strategyOptional7, 8Deployment strategy, either rolling or null.
no_waitOptional7, 8Exit when the first instance of the web process is healthy
staging_timeoutOptionalAllMax wait time for buildpack staging, in minutes
startup_timeoutOptionalAllMax wait time for app instance startup, in minutes
- put: cloud-foundryparams:
command: restartapp_name: myapp

restage

Stage the app's latest package into a droplet and restart the app with this new droplet and updated configuration (environment variables, service bindings, buildpack, stack, etc.).

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
app_nameRequiredAllThe name of the application
strategyOptional7, 8Deployment strategy, either rolling or null
no_waitOptional7, 8Exit when the first instance of the web process is healthy
staging_timeoutOptionalAllMax wait time for buildpack staging, in minutes
startup_timeoutOptionalAllMax wait time for app instance startup, in minutes
- put: cloud-foundryparams:
command: restageapp_name: myapp

delete

Delete an app

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
app_nameRequiredAllThe name of the application
delete_mapped_routesOptionalAllDelete any mapped routes. Defaults to false.
- put: cloud-foundryparams:
command: deleteapp_name: myappdelete_mapped_routes: true

rename

Rename an app

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
app_nameRequiredAllThe name of the application
new_app_nameRequiredAllThe new name of the application
- put: cloud-foundryparams:
command: renameapp_name: myappnew_app_name: myapp-new

add-network-policy

Create policy to allow direct network traffic from one app to another

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
source_appRequiredAllThe name of the source application
destination_appRequiredAllName of app to connect to
portOptionalAllPort or range of ports for connection to destination app (Default: 8080)
protocolOptionalAllProtocol to connect apps with (Default: tcp)
destination_orgOptionalAllThe org of the destination app (Default: targeted org)
destination_spaceOptionalAllThe space of the destination app (Default: targeted space)
- put: cloud-foundryparams:
command: add-network-policysource_app: frontenddestination_app: backendprotocol: tcpport: 8080

remove-network-policy

Remove network traffic policy of an app

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
source_appRequiredAllThe name of the source application
destination_appRequiredAllName of app to connect to
portRequiredAllPort or range of ports that destination app is connected with
protocolRequiredAllProtocol that apps are connected with
destination_orgOptionalAllThe org of the destination app (Default: targeted org)
destination_spaceOptionalAllThe space of the destination app (Default: targeted space)
- put: cloud-foundryparams:
command: remove-network-policysource_app: frontenddestination_app: backendprotocol: tcpport: 8080

create-buildpack

Create a buildpack

ParamsUsageCLI VersionDescription
buildpackRequiredAllThe name of the buildpack
pathRequiredAllPath to buildpack zip file, url to a zip file, or a local directory
positionRequiredAllThe order in which the buildpacks are checked during buildpack auto-detection
enabledOptionalAllSet to false to disable the buildpack from being used for staging
- put: cloud-foundryparams:
command: create-buildpackbuildpack: java_buildpack_offlinepath: https://github.com/cloudfoundry/java-buildpack/releases/download/v4.48.3/java-buildpack-v4.48.3.zipposition: 99

update-buildpack

Update a buildpack

ParamsUsageCLI VersionDescription
buildpackRequiredAllThe name of the buildpack
pathOptionalAllPath to buildpack zip file, url to a zip file, or a local directory
assign_stackOptionalAllAssign a stack to a buildpack that does not have a stack association
positionOptionalAllThe order in which the buildpacks are checked during buildpack auto-detection
enabledOptionalAllSet to false to disable the buildpack from being used for staging
lockedOptionalAllSet to true to lock the buildpack to prevent updates
- put: cloud-foundryparams:
command: update-buildpackbuildpack: java_buildpack_offlineassign_stack: cflinuxfs4

delete-buildpack

Delete a buildpack

ParamsUsageCLI VersionDescription
buildpackRequiredAllThe name of the buildpack
stackOptionalAllSpecify stack to disambiguate buildpacks with the same name. Required when buildpack name is ambiguous
- put: cloud-foundryparams:
command: delete-buildpackbuildpack: java_buildpack_offlinestack: cflinuxfs4

run-task

Run a one-off task on an app

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
app_nameRequiredAllThe name of the application
task_commandRequiredAllThe command to run for the task
task_nameOptionalAllName to give the task (generated if omitted)
memoryOptionalAllMemory limit (e.g. 256M, 1024M, 1G)
disk_quotaOptionalAllDisk limit (e.g. 256M, 1024M, 1G)
- put: cloud-foundryparams:
command: run-taskapp_name: myapptask_command: bundle exec rake db:migratetask_name: migratememory: 256Mdisk_quota: 1G

scale

Change or view the instance count, disk space limit, and memory limit for an app

ParamsUsageCLI VersionDescription
orgRequiredAllThe organization to target (Optional if set in the source config)
spaceRequiredAllThe space to target (Optional if set in the source config)
app_nameRequiredAllThe name of the application
instancesOptionalAllNumber of instances
disk_quotaOptionalAllDisk limit (e.g. 256M, 1024M, 1G)
memoryOptionalAllMemory limit (e.g. 256M, 1024M, 1G)
- put: cloud-foundryparams:
command: scaleapp_name: myappinstances: 3disk_quota: 1Gmemory: 2G

allow-space-ssh

Allow space ssh in the targeted space

  • space: Optional. The targeted space (required if not set in the source config)
- put: cf-allow-space-sshresource: cf-envparams:
command: allow-space-sshspace: myspace

disallow-space-ssh

Disallow space ssh in the targeted space

  • space: Optional. The targeted space (required if not set in the source config)
- put: cf-disallow-space-sshresource: cf-envparams:
command: disallow-space-sshspace: myspace

About

Cloud Foundry CLI Concourse Resource

Topics

Resources

Stars

46 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages