2020-07-31 12:38:00 +02:00
metadata :
name : cloudFoundryDeploy
2020-08-24 18:10:45 +02:00
description : "Deploys an application to Cloud Foundry"
2020-07-31 12:38:00 +02:00
longDescription : |
Deploys an application to a test or production space within Cloud Foundry.
spec :
inputs :
2020-08-24 18:10:45 +02:00
secrets :
- name : cfCredentialsId
2020-09-23 13:22:51 +02:00
description : Jenkins 'Username with password' credentials ID containing user and password to authenticate to the Cloud Foundry API.
2020-08-24 18:10:45 +02:00
type : jenkins
aliases :
- name : cloudFoundry/credentialsId
2022-02-21 16:08:07 +02:00
deprecated : true
2020-08-24 18:10:45 +02:00
- name : dockerCredentialsId
2020-09-23 13:22:51 +02:00
description : Jenkins 'Username with password' credentials ID containing user and password to authenticate to the Docker registry.
2020-08-24 18:10:45 +02:00
type : jenkins
2020-07-31 12:38:00 +02:00
params :
- name : apiEndpoint
type : string
description : "Cloud Foundry API endpoint"
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
- GENERAL
2020-07-31 12:38:00 +02:00
mandatory : true
default : "https://api.cf.eu10.hana.ondemand.com"
aliases :
- name : cfApiEndpoint
- name : cloudFoundry/apiEndpoint
2022-02-21 16:08:07 +02:00
deprecated : true
2020-07-31 12:38:00 +02:00
- name : appName
type : string
description : "Defines the name of the application to be deployed to the Cloud Foundry space"
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
- GENERAL
2020-07-31 12:38:00 +02:00
mandatory : false
aliases :
- name : cfAppName
- name : cloudFoundry/appName
2022-02-21 16:08:07 +02:00
deprecated : true
2020-07-31 12:38:00 +02:00
- name : artifactVersion
type : string
description : "The artifact version, used for influx reporting"
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
- GENERAL
2020-07-31 12:38:00 +02:00
mandatory : false
resourceRef :
- name : commonPipelineEnvironment
param : artifactVersion
2021-08-05 17:03:51 +02:00
- name : commitHash
type : string
description : "The commit hash, used for influx reporting"
scope :
- PARAMETERS
- STAGES
- STEPS
- GENERAL
mandatory : false
resourceRef :
- name : commonPipelineEnvironment
param : git/headCommitId
2020-07-31 12:38:00 +02:00
- name : cfHome
type : string
description : "The cf home folder used by the cf cli. If not provided the default assumed by the cf cli is used."
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
- GENERAL
2020-07-31 12:38:00 +02:00
mandatory : false
- name : cfNativeDeployParameters
type : string
description : "Additional parameters passed to cf native deployment command"
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
- GENERAL
2020-07-31 12:38:00 +02:00
mandatory : false
- name : cfPluginHome
type : string
2020-08-24 18:10:45 +02:00
description : "The cf plugin home folder used by the cf cli.
If not provided the default assumed by the cf cli is used."
2020-07-31 12:38:00 +02:00
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
- GENERAL
2020-07-31 12:38:00 +02:00
mandatory : false
- name : deployDockerImage
type : string
2020-08-24 18:10:45 +02:00
description : "Docker image deployments are supported
(via manifest file in general)[https://docs.cloudfoundry.org/devguide/deploy-apps/manifest-attributes.html#docker].
If no manifest is used, this parameter defines the image to be deployed.
The specified name of the image is passed to the `--docker-image` parameter of the cf CLI and must
adhere it's naming pattern (e.g. REPO/IMAGE:TAG).
See (cf CLI documentation)[https://docs.cloudfoundry.org/devguide/deploy-apps/push-docker.html]
for details.
Note : The used Docker registry must be visible for the targeted Cloud Foundry instance."
2020-07-31 12:38:00 +02:00
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
- GENERAL
2020-07-31 12:38:00 +02:00
mandatory : false
- name : deployTool
type : string
description : "Defines the tool which should be used for deployment."
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
- GENERAL
- name : buildTool
type : string
description : "Defines the tool which is used for building the artifact.
If provided, `deployTool` is automatically derived from it.
For MTA projects, `deployTool` defaults to `mtaDeployPlugin`.
For other projects `cf_native` will be used."
scope :
- PARAMETERS
- STAGES
- STEPS
- GENERAL
resourceRef :
- name : commonPipelineEnvironment
param : buildTool
2020-07-31 12:38:00 +02:00
- name : deployType
type : string
2020-08-31 16:10:28 +02:00
description :
"Defines the type of deployment, either `standard` deployment which results in a system
2022-11-15 15:44:52 +02:00
downtime or a zero-downtime `blue-green` deployment. If 'cf_native' as deployTool and 'blue-green'
as deployType is used in combination, your manifest.yaml may only contain one application.
2020-08-24 18:10:45 +02:00
If this application has the option 'no-route' active the deployType will be changed to 'standard'."
2020-07-31 12:38:00 +02:00
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
- GENERAL
2020-07-31 12:38:00 +02:00
mandatory : false
default : "standard"
- name : dockerPassword
type : string
2020-08-31 16:10:28 +02:00
description :
"If the specified image in `deployDockerImage` is contained in a Docker registry,
2020-08-24 18:10:45 +02:00
which requires authorization, this defines the password to be used."
2020-07-31 12:38:00 +02:00
secret : true
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
2020-07-31 12:38:00 +02:00
mandatory : false
2020-08-28 15:38:15 +02:00
resourceRef :
- name : dockerCredentialsId
type : secret
param : password
2020-07-31 12:38:00 +02:00
- name : dockerUsername
type : string
2020-08-31 16:10:28 +02:00
description :
"If the specified image in `deployDockerImage` is contained in a Docker registry,
2020-08-24 18:10:45 +02:00
which requires authorization, this defines the username to be used."
2020-07-31 12:38:00 +02:00
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
2020-07-31 12:38:00 +02:00
mandatory : false
2020-10-06 08:59:20 +02:00
secret : true
2020-08-28 15:38:15 +02:00
resourceRef :
- name : dockerCredentialsId
type : secret
param : username
2020-07-31 12:38:00 +02:00
- name : keepOldInstance
type : bool
2020-08-31 16:10:28 +02:00
description :
"In case of a `blue-green` deployment the old instance will be deleted by default.
2020-08-24 18:10:45 +02:00
If this option is set to true the old instance will remain stopped in the Cloud Foundry space."
2020-07-31 12:38:00 +02:00
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
2020-07-31 12:38:00 +02:00
mandatory : false
- name : loginParameters
type : string
2020-08-31 16:10:28 +02:00
description :
"Addition command line options for cf login command. No escaping/quoting is performed.
2020-08-24 18:10:45 +02:00
Not recommended for productive environments."
2020-07-31 12:38:00 +02:00
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
- GENERAL
2020-07-31 12:38:00 +02:00
mandatory : false
- name : manifest
type : string
description : "Defines the manifest to be used for deployment to Cloud Foundry."
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
- GENERAL
2020-07-31 12:38:00 +02:00
mandatory : false
aliases :
- name : cfManifest
- name : cloudFoundry/manifest
2022-02-21 16:08:07 +02:00
deprecated : true
2020-07-31 12:38:00 +02:00
- name : manifestVariables
type : "[]string"
2021-11-09 08:44:31 +02:00
description : Defines a list of variables in the form `key=value` which are used for variable substitution within the file given by manifest.
longDescription : |
Defines a list of variables in the form `key=value` which are used for variable substitution
within the file given by manifest.
2020-08-24 18:10:45 +02:00
This can be used to set variables like it is provided by 'cf push --var key=value'.
2021-11-09 08:44:31 +02:00
**Note:** variables defined via 'manifestVariables' always win over conflicting variables defined
2020-08-24 18:10:45 +02:00
via any file given by 'manifestVariablesFiles' - no matter what is declared before.
This is the same behavior as can be observed when using 'cf push --var' in combination
with 'cf push --vars-file'."
2021-11-09 08:44:31 +02:00
Example :
```
...
cloudFoundryDeploy :
manifestVariables :
- 'key1=value1'
- 'key2=value2'
...
```
2020-07-31 12:38:00 +02:00
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
- GENERAL
2020-07-31 12:38:00 +02:00
mandatory : false
aliases :
- name : cfManifestVariables
- name : cloudFoundry/manifestVariables
2022-02-21 16:08:07 +02:00
deprecated : true
2020-07-31 12:38:00 +02:00
- name : manifestVariablesFiles
type : "[]string"
2020-08-31 16:10:28 +02:00
description :
"path(s) of the Yaml file(s) containing the variable values to use as a
2020-08-24 18:10:45 +02:00
replacement in the manifest file. The order of the files is relevant in case there are
conflicting variable names and values within variable files.
In such a case, the values of the last file win."
2020-07-31 12:38:00 +02:00
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
- GENERAL
2020-10-16 09:44:41 +02:00
default : [ "manifest-variables.yml" ]
2020-07-31 12:38:00 +02:00
mandatory : false
aliases :
- name : cfManifestVariablesFiles
- name : cloudFoundry/manifestVariablesFiles
2022-02-21 16:08:07 +02:00
deprecated : true
2020-07-31 12:38:00 +02:00
- name : mtaDeployParameters
type : string
description : "Additional parameters passed to mta deployment command"
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
- GENERAL
2020-07-31 12:38:00 +02:00
mandatory : false
default : "-f"
- name : mtaExtensionDescriptor
type : string
description : "Defines additional extension descriptor file for deployment with the mtaDeployPlugin"
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
- GENERAL
2020-07-31 12:38:00 +02:00
mandatory : false
aliases :
- name : cloudFoundry/mtaExtensionDescriptor
2022-02-21 16:08:07 +02:00
deprecated : true
2021-01-12 10:39:04 +02:00
- name : mtaExtensionCredentials
type : "map[string]interface{}"
2022-02-09 10:33:12 +02:00
description : "Defines a map of credentials that need to be replaced in the `mtaExtensionDescriptor`. This map needs to be created as `value-to-be-replaced`:`id-of-a-credential-in-jenkins`. The placeholders in the extension descriptor file(s) looks like: `<%= value-to-be-replaced %>`. When used outside Jenkins the secret which corresponds to `id-of-a-credential-in-jenkins` needs to be provided as environment variable in screaming snake case, e.g.: `export ID_OF_A_CREDENTIAL_IN_JENKINS=<secret>`. `id-of-a-credential-in-jenkins` needs to be provided in a way so that it can be translated into a valid environment variable name (e.g. don't start with a number). `value-to-be-replaced` must match this regex: `^[-_A-Za-z0-9]+$`."
2021-01-12 10:39:04 +02:00
scope :
- PARAMETERS
- STAGES
- STEPS
- GENERAL
mandatory : false
aliases :
- name : cloudFoundry/mtaExtensionCredentials
2022-02-21 16:08:07 +02:00
deprecated : true
2020-07-31 12:38:00 +02:00
- name : mtaPath
type : string
description : "Defines the path to *.mtar for deployment with the mtaDeployPlugin"
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
- GENERAL
2020-07-31 12:38:00 +02:00
mandatory : false
resourceRef :
- name : commonPipelineEnvironment
param : mtarFilePath
- name : org
type : string
description : "Cloud Foundry target organization."
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
- GENERAL
2020-07-31 12:38:00 +02:00
aliases :
- name : cfOrg
- name : cloudFoundry/org
2022-02-21 16:08:07 +02:00
deprecated : true
2020-07-31 12:38:00 +02:00
mandatory : true
secret : false
- name : password
type : string
description : "Password"
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
2020-07-31 12:38:00 +02:00
mandatory : true
secret : true
2020-08-28 15:38:15 +02:00
resourceRef :
- name : cfCredentialsId
type : secret
param : password
2020-10-13 14:14:47 +02:00
- type : vaultSecret
2021-09-21 13:06:32 +02:00
default : cloudfoundry-$(org)-$(space)
name : cloudfoundryVaultSecretName
2020-07-31 12:38:00 +02:00
- name : smokeTestScript
type : string
2020-08-31 16:10:28 +02:00
description :
"Allows to specify a script which performs a check during blue-green deployment.
2020-08-24 18:10:45 +02:00
The script gets the FQDN as parameter and returns `exit code 0` in case check returned
`smokeTestStatusCode`.
More details can be found [here](https://github.com/bluemixgaragelondon/cf-blue-green-deploy#how-to-use).
Currently this option is only considered for deployTool `cf_native`."
2020-07-31 12:38:00 +02:00
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
- GENERAL
2020-07-31 12:38:00 +02:00
mandatory : false
default : "blueGreenCheckScript.sh"
- name : smokeTestStatusCode
type : int
description : "Expected status code returned by the check."
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
- GENERAL
2020-07-31 12:38:00 +02:00
mandatory : false
default : 200
- name : space
type : string
description : "Cloud Foundry target space"
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
- GENERAL
2020-07-31 12:38:00 +02:00
aliases :
- name : cfSpace
- name : cloudFoundry/space
2022-02-21 16:08:07 +02:00
deprecated : true
2020-07-31 12:38:00 +02:00
mandatory : true
- name : username
type : string
2022-02-21 16:08:07 +02:00
description : User name used for deployment
2020-07-31 12:38:00 +02:00
scope :
2020-08-24 18:10:45 +02:00
- PARAMETERS
- STAGES
- STEPS
2020-07-31 12:38:00 +02:00
mandatory : true
secret : true
2020-08-28 15:38:15 +02:00
resourceRef :
- name : cfCredentialsId
type : secret
param : username
2020-10-13 14:14:47 +02:00
- type : vaultSecret
2021-09-21 13:06:32 +02:00
default : cloudfoundry-$(org)-$(space)
name : cloudfoundryVaultSecretName
2020-07-31 12:38:00 +02:00
containers :
- name : cfDeploy
2022-05-17 08:53:19 +02:00
image : ppiper/cf-cli:latest
2020-07-31 12:38:00 +02:00
outputs :
resources :
- name : influx
type : influx
params :
- name : deployment_data
fields :
- name : artifactUrl
- name : deployTime
2021-08-05 17:03:51 +02:00
- name : commitHash
2020-07-31 12:38:00 +02:00
- name : jobTrigger
tags :
- name : artifactVersion
- name : deployUser
- name : deployResult
- name : cfApiEndpoint
- name : cfOrg
- name : cfSpace