mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-03-05 15:15:44 +02:00
fix code climate issues II (#715)
* fix code climate issues * fix code climate issues * fix code climate issues
This commit is contained in:
parent
cf08f3c7c8
commit
41ee87d147
@ -71,8 +71,7 @@ To setup the shared library, you need to perform the following steps:
|
||||
|
||||
1. Login to your Jenkins instance with administration privileges.
|
||||
1. Open the system configuration page (*Manage Jenkins > Configure System*).
|
||||
1. Scroll down to section *Global Pipeline Libraries* and add a new Library by
|
||||
clicking the *Add* button.
|
||||
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 *Retrieval Method* to `Modern SCM`
|
||||
@ -102,6 +101,7 @@ Feel free to open new issues for feature requests, bugs or general feedback on
|
||||
the [GitHub issues page of this project][piper-library-issues].
|
||||
|
||||
Register to our [google group][google-group] in order to get updates or for asking questions.
|
||||
|
||||
# Contributing
|
||||
|
||||
Read and understand our [contribution guidelines][piper-library-contribution]
|
||||
|
@ -11,10 +11,10 @@ Your configuration inherits from the default configuration located at [https://g
|
||||
Configuration of the Piper steps as well the Piper templates can be done in a hierarchical manner.
|
||||
|
||||
1. Directly passed step parameters will always take precedence over other configuration values and defaults
|
||||
2. Stage configuration parameters define a Jenkins pipeline stage dependent set of parameters (e.g. deployment options for the `Acceptance` stage)
|
||||
3. Step configuration defines how steps behave in general (e.g. step `cloudFoundryDeploy`)
|
||||
4. General configuration parameters define parameters which are available across step boundaries
|
||||
5. Default configuration comes with the Piper library and is always available
|
||||
1. Stage configuration parameters define a Jenkins pipeline stage dependent set of parameters (e.g. deployment options for the `Acceptance` stage)
|
||||
1. Step configuration defines how steps behave in general (e.g. step `cloudFoundryDeploy`)
|
||||
1. General configuration parameters define parameters which are available across step boundaries
|
||||
1. Default configuration comes with the Piper library and is always available
|
||||
|
||||

|
||||
|
||||
|
@ -33,10 +33,10 @@ The basic workflow is as follows:
|
||||
|
||||
**Note:** The blank line between message header and message description is mandatory.
|
||||
|
||||
2. To communicate with SAP Solution Manager, the pipeline uses credentials that must be stored on Jenkins using the credential ID `CM`. For more information, see [checkChangeInDevelopment](https://sap.github.io/jenkins-library/steps/checkChangeInDevelopment/).
|
||||
3. The required transport request is created on the fly. **Note:** The change document can contain various components (for example, UI and backend components).
|
||||
4. The changes of your development team trigger the Jenkins pipeline. It builds and validates the changes and attaches them to the respective transport request.
|
||||
5. As soon as the development process is completed, the change document in SAP Solution Manager can be set to status `to be tested` and all components can be transported to the test system.
|
||||
1. To communicate with SAP Solution Manager, the pipeline uses credentials that must be stored on Jenkins using the credential ID `CM`. For more information, see [checkChangeInDevelopment](https://sap.github.io/jenkins-library/steps/checkChangeInDevelopment/).
|
||||
1. The required transport request is created on the fly. **Note:** The change document can contain various components (for example, UI and backend components).
|
||||
1. The changes of your development team trigger the Jenkins pipeline. It builds and validates the changes and attaches them to the respective transport request.
|
||||
1. As soon as the development process is completed, the change document in SAP Solution Manager can be set to status `to be tested` and all components can be transported to the test system.
|
||||
|
||||

|
||||
###### Hybrid Application Development Workflow
|
||||
|
@ -32,8 +32,7 @@ resource in an custom shared library.
|
||||
|
||||
// inside the shared lib denoted by 'foo' the additional configuration file
|
||||
// needs to be located under 'resources' ('resoures/myConfig.yml')
|
||||
prepareDefaultValues script: this,
|
||||
customDefaults: 'myConfig.yml'
|
||||
prepareDefaultValues script: this, customDefaults: 'myConfig.yml'
|
||||
```
|
||||
|
||||
Example content of `'resources/myConfig.yml'` in branch `'master'` of the repository denoted by
|
||||
@ -79,11 +78,13 @@ The parameters can also be provided when the step is invoked:
|
||||
// explict endpoint provided, we search for changeDocumentId
|
||||
// starting at the previous commit (HEAD~1) rather than on
|
||||
// 'origin/master' (the default).
|
||||
checkChangeInDevelopment script:this
|
||||
checkChangeInDevelopment(
|
||||
script: this
|
||||
changeManagement: [
|
||||
endpoint: 'https:example.org/cm'
|
||||
git: [
|
||||
from: 'HEAD~1'
|
||||
]
|
||||
]
|
||||
)
|
||||
```
|
||||
|
@ -43,7 +43,7 @@ Once you have started both docker containers and Influx and Grafana are running
|
||||
To setup your Jenkins you need to do two configuration steps:
|
||||
|
||||
1. Configure Jenkins (via Manage Jenkins)
|
||||
2. Adapt pipeline configuration
|
||||
1. Adapt pipeline configuration
|
||||
|
||||
### Configure Jenkins
|
||||
|
||||
|
@ -10,7 +10,7 @@ Kaniko expects a Docker `config.json` file containing the credential information
|
||||
You can create it like explained in the Docker Success Center in the articale about [How to generate a new auth in the config.json file](https://success.docker.com/article/generate-new-auth-in-config-json-file).
|
||||
|
||||
Please copy this file and upload it to your Jenkins for example<br />
|
||||
via _Jenkins_ -> _Credentials_ -> _System_ -> _Global credentials (unrestricted)_ -> _ Add Credentials_ ->
|
||||
via _Jenkins_ -> _Credentials_ -> _System_ -> _Global credentials (unrestricted)_ -> _Add Credentials_ ->
|
||||
|
||||
* Kind: _Secret file_
|
||||
* File: upload your `config.json` file
|
||||
|
@ -23,8 +23,7 @@ resource in an custom shared library.
|
||||
|
||||
// inside the shared lib denoted by 'foo' the additional configuration file
|
||||
// needs to be located under 'resources' ('resoures/myConfig.yml')
|
||||
prepareDefaultValues script: this,
|
||||
customDefaults: 'myConfig.yml'
|
||||
prepareDefaultValues script: this, customDefaults: 'myConfig.yml'
|
||||
```
|
||||
|
||||
Example content of `'resources/myConfig.yml'` in branch `'master'` of the repository denoted by
|
||||
|
@ -74,21 +74,25 @@ The parameters can also be provided when the step is invoked. For examples see b
|
||||
|
||||
```groovy
|
||||
// SOLMAN
|
||||
transportRequestUploadFile script:this,
|
||||
transportRequestUploadFile(
|
||||
script: this,
|
||||
changeDocumentId: '001', // typically provided via git commit history
|
||||
transportRequestId: '001', // typically provided via git commit history
|
||||
applicationId: '001',
|
||||
filePath: '/path',
|
||||
changeManagement:[
|
||||
changeManagement: [
|
||||
type: 'SOLMAN'
|
||||
endpoint: 'https://example.org/cm'
|
||||
]
|
||||
)
|
||||
// CTS
|
||||
transportRequestUploadFile script:this,
|
||||
transportRequestUploadFile(
|
||||
script: this,
|
||||
transportRequestId: '001', // typically provided via git commit history
|
||||
filePath: '/path',
|
||||
changeManagement:[
|
||||
changeManagement: [
|
||||
type: 'CTS'
|
||||
endpoint: 'https://example.org/cm'
|
||||
]
|
||||
)
|
||||
```
|
||||
|
4
pom.xml
4
pom.xml
@ -1,6 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>org.jenkins-ci.plugins</groupId>
|
||||
|
@ -37,4 +37,3 @@ class MtaUtils {
|
||||
if (!script.fileExists(targetMtaDescriptor)) throw new AbortException("'${targetMtaDescriptor}' has not been generated.")
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user