diff --git a/README.md b/README.md index af3a99339..fc413e63d 100644 --- a/README.md +++ b/README.md @@ -74,8 +74,7 @@ To setup the shared library, you need to perform the following steps: 1. Scroll down to section *Global Pipeline Libraries* and add a new Library by clicking the *Add* button. 1. set *Library Name* to `piper-lib-os` - 1. set *Default Version* to the branch or tag you want to consume (e.g. - `master` or `v0.1`) + 1. set *Default Version* to the branch or tag you want to consume (e.g. `master` or `v0.1`) 1. set *Retrieval Method* to `Modern SCM` 1. set *Source Code Management* to `Git` 1. set *Project Repository* to `https://github.com/SAP/jenkins-library` diff --git a/documentation/docs/scenarios/ui5-sap-cp/Readme.md b/documentation/docs/scenarios/ui5-sap-cp/Readme.md index 113a3dbe1..0ad0201f1 100644 --- a/documentation/docs/scenarios/ui5-sap-cp/Readme.md +++ b/documentation/docs/scenarios/ui5-sap-cp/Readme.md @@ -11,12 +11,10 @@ Build an application based on SAPUI5 or SAP Fiori with Jenkins and deploy the bu * You have installed Node.js including node and npm. See [Node.js](https://nodejs.org/en/download/). * You have installed the SAP Cloud Platform Neo Environment SDK. See [SAP Development Tools](https://tools.hana.ondemand.com/#cloud). - ### Project Prerequisites This scenario requires additional files in your project and in the execution environment on your Jenkins instance. - On the project level, provide and adjust the following template: | File Name | Description | Position | @@ -26,12 +24,10 @@ On the project level, provide and adjust the following template: | [`package.json`](https://github.com/SAP/jenkins-library/blob/master/documentation/docs/scenarios/ui5-sap-cp/files/package.json) | This file lists the required development dependencies for the build. | Add the content of the `package.json` file to your existing `package.json` file. | | [`Gruntfile.js`](https://github.com/SAP/jenkins-library/blob/master/documentation/docs/scenarios/ui5-sap-cp/files/Gruntfile.js) | This file controls the grunt build. By default the tasks `clean`, `build`, and `lint` are executed. | Place the `Gruntfile.js` in the root directory of your project. | - ## Context This scenario combines various different steps to create a complete pipeline. - In this scenario, we want to show how to build an application based on SAPUI5 or SAP Fiori by using the multi-target application (MTA) concept and how to deploy the build result into an SAP Cloud Platform account in the Neo environment. This document comprises the [mtaBuild](https://sap.github.io/jenkins-library/steps/mtaBuild/) and the [neoDeploy](https://sap.github.io/jenkins-library/steps/neoDeploy/) steps. ![This pipeline in Jenkins Blue Ocean](images/pipeline.jpg) @@ -73,7 +69,6 @@ steps: | `buildTarget` | The target platform to which the mtar can be deployed. Possible values are: `CF`, `NEO`, `XSA` | | `mtaJarLocation` | The location of the multi-target application archive builder jar file, including file name and extension. | - #### Configuration for the Deployment to SAP Cloud Platform | Parameter | Description | @@ -83,7 +78,6 @@ steps: | `host` | The SAP Cloud Platform host to deploy to. | | `neoHome` | The path to the `neo-java-web-sdk` tool that is used for the deployment. | - ### Parameters For the detailed description of the relevant parameters, see: diff --git a/documentation/docs/steps/influxWriteData.md b/documentation/docs/steps/influxWriteData.md index e51eeb7ff..3842e4fca 100644 --- a/documentation/docs/steps/influxWriteData.md +++ b/documentation/docs/steps/influxWriteData.md @@ -15,8 +15,8 @@ Very basic setup can be done like that (with user "admin" and password "adminPwd For more advanced setup please reach out to the respective documentation: -- https://hub.docker.com/_/influxdb/ (and https://github.com/docker-library/docs/tree/master/influxdb) -- https://hub.docker.com/r/grafana/grafana/ (and https://github.com/grafana/grafana-docker) +- InfluxDB ([Docker Hub](https://hub.docker.com/_/influxdb/) [GitHub](https://github.com/docker-library/docs/tree/master/influxdb)) +- Grafana ([Docker Hub](https://hub.docker.com/r/grafana/grafana/) [GitHub](https://github.com/grafana/grafana-docker)) After you have started your InfluxDB docker you need to create a database: diff --git a/documentation/docs/steps/npmExecute.md b/documentation/docs/steps/npmExecute.md index ba9384961..45d58ffb7 100644 --- a/documentation/docs/steps/npmExecute.md +++ b/documentation/docs/steps/npmExecute.md @@ -1,7 +1,6 @@ # ${docGenStepName} - ## ${docGenDescription} ## ${docGenParameters} diff --git a/documentation/docs/steps/seleniumExecuteTests.md b/documentation/docs/steps/seleniumExecuteTests.md index 2f55c2423..51fc4a057 100644 --- a/documentation/docs/steps/seleniumExecuteTests.md +++ b/documentation/docs/steps/seleniumExecuteTests.md @@ -18,7 +18,7 @@ seleniumExecuteTests (script: this) { ### Example test using WebdriverIO -Example based on http://webdriver.io/guide/getstarted/modes.html and http://webdriver.io/guide.html +Example based on and #### Configuration for Local Docker Environment diff --git a/documentation/docs/steps/transportRequestRelease.md b/documentation/docs/steps/transportRequestRelease.md index 48cabfd7a..8902d603d 100644 --- a/documentation/docs/steps/transportRequestRelease.md +++ b/documentation/docs/steps/transportRequestRelease.md @@ -8,11 +8,8 @@ ## ${docGenParameters} - ## ${docGenConfiguration} - - The step is configured using a customer configuration file provided as resource in an custom shared library. diff --git a/pom.xml b/pom.xml index 016ea0313..228bbd356 100644 --- a/pom.xml +++ b/pom.xml @@ -17,10 +17,10 @@ https://sap.github.io/jenkins-library/ - - Apache License 2.0 - https://github.com/SAP/jenkins-library/blob/master/LICENSE - + + Apache License 2.0 + https://github.com/SAP/jenkins-library/blob/master/LICENSE + diff --git a/src/com/sap/piper/GitUtils.groovy b/src/com/sap/piper/GitUtils.groovy index b24a3ce84..ca1c12243 100644 --- a/src/com/sap/piper/GitUtils.groovy +++ b/src/com/sap/piper/GitUtils.groovy @@ -33,25 +33,27 @@ String getGitCommitId() { return sh(returnStdout: true, script: 'git rev-parse HEAD').trim() } -String[] extractLogLines(String filter = '', - String from = 'origin/master', - String to = 'HEAD', - String format = '%b') { +String[] extractLogLines( + String filter = '', + String from = 'origin/master', + String to = 'HEAD', + String format = '%b' +) { - // Checks below: there was an value provided from outside, but the value was null. - // Throwing an exception is more transparent than making a fallback to the defaults - // used in case the paramter is omitted in the signature. - if(filter == null) throw new IllegalArgumentException('Parameter \'filter\' not provided.') - if(! from?.trim()) throw new IllegalArgumentException('Parameter \'from\' not provided.') - if(! to?.trim()) throw new IllegalArgumentException('Parameter \'to\' not provided.') - if(! format?.trim()) throw new IllegalArgumentException('Parameter \'format\' not provided.') + // Checks below: there was an value provided from outside, but the value was null. + // Throwing an exception is more transparent than making a fallback to the defaults + // used in case the paramter is omitted in the signature. + if(filter == null) throw new IllegalArgumentException('Parameter \'filter\' not provided.') + if(! from?.trim()) throw new IllegalArgumentException('Parameter \'from\' not provided.') + if(! to?.trim()) throw new IllegalArgumentException('Parameter \'to\' not provided.') + if(! format?.trim()) throw new IllegalArgumentException('Parameter \'format\' not provided.') sh ( returnStdout: true, - script: """#!/bin/bash - git log --pretty=format:${format} ${from}..${to} - """ - )?.split('\n') - ?.findAll { line -> line ==~ /${filter}/ } + script: """#!/bin/bash + git log --pretty=format:${format} ${from}..${to} + """ + )?.split('\n') + ?.findAll { line -> line ==~ /${filter}/ } } diff --git a/src/com/sap/piper/cm/ChangeManagement.groovy b/src/com/sap/piper/cm/ChangeManagement.groovy index 99f196b08..de41edc70 100644 --- a/src/com/sap/piper/cm/ChangeManagement.groovy +++ b/src/com/sap/piper/cm/ChangeManagement.groovy @@ -17,32 +17,32 @@ public class ChangeManagement implements Serializable { } String getChangeDocumentId( - String from = 'origin/master', - String to = 'HEAD', - String label = 'ChangeDocument\\s?:', - String format = '%b' - ) { + String from = 'origin/master', + String to = 'HEAD', + String label = 'ChangeDocument\\s?:', + String format = '%b' + ) { return getLabeledItem('ChangeDocumentId', from, to, label, format) } String getTransportRequestId( - String from = 'origin/master', - String to = 'HEAD', - String label = 'TransportRequest\\s?:', - String format = '%b' - ) { + String from = 'origin/master', + String to = 'HEAD', + String label = 'TransportRequest\\s?:', + String format = '%b' + ) { return getLabeledItem('TransportRequestId', from, to, label, format) } private String getLabeledItem( - String name, - String from, - String to, - String label, - String format - ) { + String name, + String from, + String to, + String label, + String format + ) { if( ! gitUtils.insideWorkTree() ) { throw new ChangeManagementException("Cannot retrieve ${name}. Not in a git work tree. ${name} is extracted from git commit messages.") diff --git a/vars/durationMeasure.groovy b/vars/durationMeasure.groovy index aa86886f5..33f7a15a1 100644 --- a/vars/durationMeasure.groovy +++ b/vars/durationMeasure.groovy @@ -42,4 +42,3 @@ def call(Map parameters = [:], body) { return duration } - diff --git a/vars/pipelineExecute.groovy b/vars/pipelineExecute.groovy index f0ba5bf0c..a2dbdac5f 100644 --- a/vars/pipelineExecute.groovy +++ b/vars/pipelineExecute.groovy @@ -54,15 +54,19 @@ void call(Map parameters = [:]) { deleteDir() - checkout([$class: 'GitSCM', branches: [[name: config.branch]], - doGenerateSubmoduleConfigurations: false, - extensions: [[$class: 'SparseCheckoutPaths', - sparseCheckoutPaths: [[path: config.path]] - ]], - submoduleCfg: [], - userRemoteConfigs: [[credentialsId: config.credentialsId, - url: config.repoUrl - ]] + checkout([ + $class: 'GitSCM', + branches: [[name: config.branch]], + doGenerateSubmoduleConfigurations: false, + extensions: [[ + $class: 'SparseCheckoutPaths', + sparseCheckoutPaths: [[path: config.path]] + ]], + submoduleCfg: [], + userRemoteConfigs: [[ + credentialsId: config.credentialsId, + url: config.repoUrl + ]] ]) } diff --git a/vars/transportRequestCreate.groovy b/vars/transportRequestCreate.groovy index f4ff51da7..974d86911 100644 --- a/vars/transportRequestCreate.groovy +++ b/vars/transportRequestCreate.groovy @@ -184,30 +184,33 @@ void call(parameters = [:]) { try { if(backendType == BackendType.SOLMAN) { transportRequestId = cm.createTransportRequestSOLMAN( - configuration.changeManagement.solman.docker, - configuration.changeDocumentId, - configuration.developmentSystemId, - configuration.changeManagement.endpoint, - configuration.changeManagement.credentialsId, - configuration.changeManagement.clientOpts) + configuration.changeManagement.solman.docker, + configuration.changeDocumentId, + configuration.developmentSystemId, + configuration.changeManagement.endpoint, + configuration.changeManagement.credentialsId, + configuration.changeManagement.clientOpts + ) } else if(backendType == BackendType.CTS) { transportRequestId = cm.createTransportRequestCTS( - configuration.changeManagement.cts.docker, - configuration.transportType, - configuration.targetSystem, - configuration.description, - configuration.changeManagement.endpoint, - configuration.changeManagement.credentialsId, - configuration.changeManagement.clientOpts) + configuration.changeManagement.cts.docker, + configuration.transportType, + configuration.targetSystem, + configuration.description, + configuration.changeManagement.endpoint, + configuration.changeManagement.credentialsId, + configuration.changeManagement.clientOpts + ) } else if (backendType == BackendType.RFC) { transportRequestId = cm.createTransportRequestRFC( - configuration.changeManagement.rfc.docker, - configuration.changeManagement.endpoint, - configuration.changeManagement.rfc.developmentInstance, - configuration.changeManagement.rfc.developmentClient, - configuration.changeManagement.credentialsId, - configuration.description, - configuration.verbose) + configuration.changeManagement.rfc.docker, + configuration.changeManagement.endpoint, + configuration.changeManagement.rfc.developmentInstance, + configuration.changeManagement.rfc.developmentClient, + configuration.changeManagement.credentialsId, + configuration.description, + configuration.verbose + ) } else { throw new IllegalArgumentException("Invalid backend type: '${backendType}'.") } diff --git a/vars/transportRequestRelease.groovy b/vars/transportRequestRelease.groovy index 7df08c7ee..5bd950ff9 100644 --- a/vars/transportRequestRelease.groovy +++ b/vars/transportRequestRelease.groovy @@ -70,7 +70,7 @@ import static com.sap.piper.cm.StepHelpers.getBackendTypeAndLogInfoIfCMIntegrati 'transportRequestId', /** @see transportRequestCreate */ 'verbose', - ]) +]) /** Releases a Transport Request. */ @GenerateDocumentation