2017-07-11 15:12:03 +02:00
# neoDeploy
## Description
Deploys an Application to SAP Cloud Platform (SAP CP) using the SAP Cloud Platform Console Client (Neo Java Web SDK).
2017-12-28 17:16:02 +02:00
2017-07-11 15:12:03 +02:00
## Prerequisites
* **SAP CP account** - the account to where the application is deployed.
* **SAP CP user for deployment** - a user with deployment permissions in the given account.
* **Jenkins credentials for deployment** - must be configured in Jenkins credentials with a dedicated Id.
![Jenkins credentials configuration ](../images/neo_credentials.png )
2017-12-28 17:16:02 +02:00
2017-07-11 15:12:03 +02:00
* **Neo Java Web SDK** - can be downloaded from [Maven Central ](http://central.maven.org/maven2/com/sap/cloud/neo-java-web-sdk/ ). The Neo Java Web SDK
needs to be extracted into the folder provided by `neoHome` . In case this parameters is not provided and there is no NEO_HOME parameter in the environment
2017-12-27 12:37:53 +02:00
`<neoRoot>/tools` needs to be in the `PATH` . This step is also capable of triggering the neo deploy tool provided inside a docker image.
2017-07-11 15:12:03 +02:00
* **Java 8 or higher** - needed by the *Neo-Java-Web-SDK*
2017-12-28 17:16:02 +02:00
## Parameters when using MTA deployment method (default - MTA)
2018-03-08 16:41:57 +02:00
| parameter | mandatory | default | possible values |
| -------------------|-----------|-------------------------------|-------------------------------------------------|
| `account` | no | | |
| `archivePath` | yes | | |
| `deployAccount` deprecated, use `account` | no | | |
2018-03-08 16:45:50 +02:00
| `deployHost` deprecated, use `host` | no | | |
| `deployMode` | yes | `'mta'` | `'mta'` , `'warParams'` , `'warPropertiesFile'` |
2018-03-08 16:41:57 +02:00
| `host` | no | | |
| `neoCredentialsId` | no | `'CI_CREDENTIALS_ID'` | |
| `neoHome` | no | | |
2018-03-08 16:45:50 +02:00
| `script` | yes | | |
2018-02-27 10:30:44 +02:00
2017-12-28 17:16:02 +02:00
## Parameters when using WAR file deployment method with .properties file (WAR_PROPERTIESFILE)
2018-03-08 16:41:57 +02:00
| parameter | mandatory | default | possible values |
| -------------------|-----------|-------------------------------|-------------------------------------------------|
| `archivePath` | yes | | |
| `deployMode` | yes | `'mta'` | `'mta'` , `'warParams'` , `'warPropertiesFile'` |
| `neoCredentialsId` | no | `'CI_CREDENTIALS_ID'` | |
| `neoHome` | no | | |
| `propertiesFile` | yes | | |
2018-03-08 16:45:50 +02:00
| `script` | yes | | |
| `warAction` | yes | `'deploy'` | `'deploy'` , `'rolling-update'` |
2018-02-27 10:30:44 +02:00
2017-12-28 17:16:02 +02:00
## Parameters when using WAR file deployment method witout .properties file - with parameters (WAR_PARAMS)
2018-03-08 16:41:57 +02:00
| parameter | mandatory | default | possible values |
| -------------------|-----------|-------------------------------|-------------------------------------------------|
| `account` | no | | |
2018-03-08 16:45:50 +02:00
| `applicationName` | yes | | |
2018-03-08 16:41:57 +02:00
| `archivePath` | yes | | |
| `deployAccount` deprecated, use `account` | no | |
2018-03-08 16:45:50 +02:00
| `deployHost` deprecated, use `host` | no | |
| `deployMode` | yes | `'mta'` | `'mta'` , `'warParams'` , `'warPropertiesFile'` |
2018-03-08 16:41:57 +02:00
| `host` | no | | |
| `neoCredentialsId` | no | `'CI_CREDENTIALS_ID'` | |
| `neoHome` | no | | |
| `runtime` | yes | | |
| `runtime-version` | yes | | |
2018-03-08 16:45:50 +02:00
| `script` | yes | | |
2018-03-08 16:41:57 +02:00
| `vmSize` | no | `'lite'` | `'lite'` , `'pro'` , `'prem'` , `'prem-plus'` |
2018-03-08 16:45:50 +02:00
| `warAction` | yes | `'deploy'` | `'deploy'` , `'rolling-update'` |
2017-12-28 14:10:11 +02:00
2018-03-09 10:40:33 +02:00
* `account` - The SAP Cloud Platform account to deploy to.
2018-03-09 10:26:26 +02:00
* `applicationName` - Name of the application you want to manage, configure, or deploy
2017-11-24 16:59:34 +02:00
* `archivePath` - The path to the archive for deployment to SAP CP.
2018-03-09 10:26:26 +02:00
* `deployAccount` - The SAP Cloud Platform account to deploy to.
* `deployHost` - The SAP Cloud Platform host to deploy to.
* `deployMode` - The deployment mode which should be used. Available options are `'MTA'` (default), `'WAR_PARAMS'` (deploying WAR file and passing all the deployment parameters via the function call) and `'WAR_PROPERTIESFILE'` (deploying WAR file and putting all the deployment parameters in a .properties file)
2018-03-09 10:39:19 +02:00
* `neoCredentialsId` - The Jenkins credentials containing user and password used for SAP CP deployment.
2017-11-24 16:59:34 +02:00
* `neoHome` - The path to the `neo-java-web-sdk` tool used for SAP CP deployment. If no parameter is provided, the path is retrieved from the Jenkins environment variables using `env.NEO_HOME` . If this Jenkins environment variable is not set it is assumed that the tool is available in the `PATH` .
2017-12-28 14:10:11 +02:00
* `propertiesFile` - The path to the .properties file in which all necessary deployment properties for the application are defined.
* `runtime` - Name of SAP Cloud Platform application runtime
* `runtime-version` - Version of SAP Cloud Platform application runtime
2018-03-09 10:26:26 +02:00
* `script` - The common script environment of the Jenkinsfile run. Typically `this` is passed to this parameter. This allows the function to access the [`commonPipelineEnvironment` ](commonPipelineEnvironment.md ) for retrieving e.g. configuration parameters.
2018-03-08 16:41:57 +02:00
* `vmSize` - Compute unit (VM) size. Acceptable values: lite, pro, prem, prem-plus.
2018-03-09 10:26:26 +02:00
* `warAction` - Action mode when using WAR file mode. Available options are `deploy` (default) and `rolling-update` which performs update of an application without downtime in one go.
2017-07-11 15:12:03 +02:00
2018-02-27 10:30:44 +02:00
The step is prepared for being executed in docker. The corresponding parameters can be applied. See step `dockerExecute` for details.
2017-07-11 15:12:03 +02:00
## Return value
none
## Side effects
none
## Exceptions
2017-11-24 16:59:34 +02:00
* `Exception` :
2017-07-11 15:12:03 +02:00
* If `archivePath` is not provided.
2017-12-28 14:10:11 +02:00
* If `propertiesFile` is not provided (when using `'WAR_PROPERTIESFILE'` deployment mode).
* If `applicationName` is not provided (when using `'WAR_PARAMS'` deployment mode).
* If `runtime` is not provided (when using `'WAR_PARAMS'` deployment mode).
* If `runtime-version` is not provided (when using `'WAR_PARAMS'` deployment mode).
2017-11-24 16:59:34 +02:00
* `AbortException` :
2017-07-11 15:12:03 +02:00
* If neo-java-web-sdk is not installed, or `neoHome` is wrong.
* If `deployHost` is wrong.
* If `deployAccount` is wrong.
2017-11-24 16:59:34 +02:00
* `CredentialNotFoundException` :
2017-07-11 15:12:03 +02:00
* If the credentials cannot be resolved.
## Example
```groovy
neoDeploy script: this, archivePath: 'path/to/archiveFile.mtar', credentialsId: 'my-credentials-id'
```
2017-12-27 12:37:53 +02:00
Example configuration:
```
steps:
< ... >
neoDeploy:
account: < myDeployAccount >
host: hana.example.org
```