mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-03-03 15:02:35 +02:00
Merge remote-tracking branch 'origin/docGeneration' into docGeneration
This commit is contained in:
commit
96d70d8eb1
40
.travis.yml
40
.travis.yml
@ -16,6 +16,7 @@ cache:
|
||||
# Travis Lifecycle: https://docs.travis-ci.com/user/job-lifecycle#the-job-lifecycle
|
||||
# Travis Stages: https://docs.travis-ci.com/user/build-stages/
|
||||
# Travis Conditions: https://docs.travis-ci.com/user/conditional-builds-stages-jobs
|
||||
# Travis GHPages deploy provider: https://docs.travis-ci.com/user/deployment/pages/
|
||||
jobs:
|
||||
include:
|
||||
- stage: Tests
|
||||
@ -28,33 +29,22 @@ jobs:
|
||||
after_script:
|
||||
- JACOCO_SOURCE_PATH="src vars test" ./cc-test-reporter format-coverage target/site/jacoco/jacoco.xml --input-type jacoco
|
||||
- ./cc-test-reporter upload-coverage
|
||||
- name: Docs Build
|
||||
if: type = pull_request
|
||||
install: docker pull squidfunk/mkdocs-material:3.0.4
|
||||
script:
|
||||
- |
|
||||
cp -r documentation/docs documentation/docs-tmp
|
||||
documentation/bin/createDocu.sh vars documentation/docs-tmp/steps
|
||||
docker run --rm -it -v ${TRAVIS_BUILD_DIR}:/docs -w /docs/documentation squidfunk/mkdocs-material:3.0.4 build --clean --verbose --strict
|
||||
- name: Consumer Tests
|
||||
if: repo = "SAP/jenkins-library" && ( (type != pull_request && branch =~ /^master$|^it\/.*$/) || (type == pull_request && head_repo = "SAP/jenkins-library" && head_branch =~ /^it\/.*$/) )
|
||||
script: cd consumer-test && chmod +x integrationTestController.sh && ./integrationTestController.sh
|
||||
|
||||
- stage: Docs
|
||||
name: Deploy
|
||||
if: repo = "SAP/jenkins-library" AND branch = master AND NOT type = pull_request
|
||||
install:
|
||||
- docker pull squidfunk/mkdocs-material:3.0.4
|
||||
- |
|
||||
echo "Found change on master: Deployment of documentation"
|
||||
PRIVATE_KEY="cfg/id_rsa"
|
||||
openssl aes-256-cbc -K $encrypted_12c8071d2874_key -iv $encrypted_12c8071d2874_iv -in cfg/id_rsa.enc -out "${PRIVATE_KEY}" -d
|
||||
chmod a+x gh-pages-deploy.sh
|
||||
cp -r documentation/docs documentation/docs-tmp
|
||||
documentation/bin/createDocu.sh vars documentation/docs-tmp/steps
|
||||
script: docker run --rm -it --entrypoint "./gh-pages-deploy.sh" -e "TRAVIS_REPO_SLUG=${TRAVIS_REPO_SLUG}" -v ${TRAVIS_BUILD_DIR}:/docs -w /docs squidfunk/mkdocs-material:3.0.4
|
||||
# TODO: make use of GHPages deploy provider: https://docs.travis-ci.com/user/deployment/pages/
|
||||
|
||||
#notifications:
|
||||
# slack:
|
||||
# secure: UYzfd4QYLtAX39r8LzV1dYp7cKMhYRRjI/xswMEkR+RgdMWxVPPH3kcsNLwkdNGSPn1b8Aidz8YLss9JolrepWjwI283dK8EUthZAOw03+PmL5X/3nOJ7aGv0sxwYqF5ypltBrerTf6jtPUTcQdtao+0O8bgnzShc6nWWE4MLXonjOm1pZLRUo81un+0bzm8C2ABIeHC6xuZCRycXP5u1mW1nDLK3900uY1rxIDTSZKEzA0IzLQhE9uROvI1r48fW8cKJQQjMMO5PPorq+0eDl2YTE8rQr9ldvuRE7A/ubsOQR0N5F8iAv1JTZXuXGt62fw6eKDQ1h94suEk7X+baV0EwlfhsHXcI1MxRFwxNSr9k1WaVFfA4TrM8XYBAcW3JGRA51ZK3q4EcjpuxpupaA7kZDtH53W7ePzH2TIp6yknln1q+yfcsP7cGv38sSKpKwOyMgAPRElkZzcoo31kw/PLzKPXYJEovRqx/0lWzczbFSscsroNaGCavC02++bUnyUXW2W+PG4gDSBFVZjtrvTPKnZ6DpHXV97x6xC/CzyhFj/Nf+ao/J9IIfocnc4vXJojwS550KIvM7xCDJwa/+29dajj2l6dQqrcOe3UT3O5UGU9I0KkGEDMfkLOD71eRy58qiYz3y953e52DvvzWQJbvfuk8ubMO+Fmn4GyRz8=
|
||||
name: Build & Deploy
|
||||
install: docker pull squidfunk/mkdocs-material:3.0.4
|
||||
before_script: documentation/bin/createDocu.sh
|
||||
script: docker run --rm -it -v ${TRAVIS_BUILD_DIR}/documentation:/docs squidfunk/mkdocs-material:3.0.4 build --clean --strict
|
||||
deploy:
|
||||
on:
|
||||
branch: master
|
||||
provider: pages
|
||||
skip_cleanup: true
|
||||
github_token: ${GITHUB_TOKEN}
|
||||
name: 'Travis CI Publisher'
|
||||
local_dir: 'documentation/docs-gen'
|
||||
keep_history: true
|
||||
#verbose: true
|
||||
|
@ -1,41 +1,17 @@
|
||||
# transportRequestRelease
|
||||
# ${docGenStepName}
|
||||
|
||||
## Description
|
||||
|
||||
Releases a Transport Request.
|
||||
## ${docGenDescription}
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* **[Change Management Client 2.0.0 or compatible version](http://central.maven.org/maven2/com/sap/devops/cmclient/dist.cli/)** - available for download on Maven Central.
|
||||
|
||||
## Parameters
|
||||
## ${docGenParameters}
|
||||
|
||||
| parameter | mandatory | default | possible values |
|
||||
| -----------------|-----------|--------------------------------------------------------|--------------------|
|
||||
| `script` | yes | | |
|
||||
| `changeDocumentId` | `SOLMAN` only | | |
|
||||
| `transportRequestId`| yes | | |
|
||||
| `changeManagement/changeDocumentLabel` | no | `ChangeDocument\s?:` | regex pattern |
|
||||
| `changeManagment/transportRequestLabel` | no | `TransportRequest\s?:` | regex pattern |
|
||||
| `changeManagement/credentialsId` | yes | | |
|
||||
| `changeManagement/endpoint` | yes | | |
|
||||
| `changeManagement/git/from` | no | `origin/master` | |
|
||||
| `changeManagement/git/to` | no | `HEAD` | |
|
||||
| `changeManagement/git/format` | no | `%b` | see `git log --help` |
|
||||
| `changeManagement/type` | no | `SOLMAN` | `SOLMAN`, `CTS` |
|
||||
|
||||
* `script` - The common script environment of the Jenkinsfile running. Typically the reference to the script calling the pipeline step is provided with the `this` parameter, as in `script: this`. This allows the function to access the [`commonPipelineEnvironment`](commonPipelineEnvironment.md) for retrieving, for example, configuration parameters.
|
||||
* `changeDocumentId` - for `SOLMAN` only. The id of the change document related to the transport request to release.
|
||||
* `transportRequestId` - The id of the transport request to release.
|
||||
* `changeManagement/changeDocumentLabel` - for `SOLMAN` only. A pattern used for identifying lines holding the change document id.
|
||||
* `changeManagment/transportRequestLabel` - A pattern used for identifying lines holding the transport request id.
|
||||
* `changeManagement/credentialsId` - The credentials to connect to the service endpoint (Solution Manager, ABAP System).
|
||||
* `changeManagement/endpoint` - The service endpoint (Solution Manager, ABAP System).
|
||||
* `changeManagement/git/from` - The starting point for retrieving the change document id and/or transport request id
|
||||
* `changeManagement/git/to` - The end point for retrieving the change document id and/or transport request id
|
||||
* `changeManagement/git/format` - Specifies what part of the commit is scanned. By default the body of the commit message is scanned.
|
||||
## ${docGenConfiguration}
|
||||
|
||||
|
||||
## Step configuration
|
||||
|
||||
The step is configured using a customer configuration file provided as
|
||||
resource in an custom shared library.
|
||||
|
@ -1,46 +1,14 @@
|
||||
# transportRequestUploadFile
|
||||
# ${docGenStepName}
|
||||
|
||||
## Description
|
||||
|
||||
Uploads a file to a Transport Request.
|
||||
## ${docGenDescription}
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* **[Change Management Client 2.0.0 or compatible version](http://central.maven.org/maven2/com/sap/devops/cmclient/dist.cli/)** - available for download on Maven Central.
|
||||
|
||||
## Parameters
|
||||
## ${docGenParameters}
|
||||
|
||||
| parameter | mandatory | default | possible values |
|
||||
| -----------------|-----------|--------------------------------------------------------|--------------------|
|
||||
| `script` | yes | | |
|
||||
| `changeDocumentId` | `SOLMAN` only | | |
|
||||
| `transportRequestId`| yes | | |
|
||||
| `applicationId` | `SOLMAN` only | | |
|
||||
| `filePath` | yes | | |
|
||||
| `changeManagement/credentialsId` | yes | | |
|
||||
| `changeManagement/endpoint` | yes | | |
|
||||
| `changeManagement/git/from` | no | `origin/master` | |
|
||||
| `changeManagement/git/to` | no | `HEAD` | |
|
||||
| `changeManagement/changeDocumentLabel` | no | `ChangeDocument\s?:` | regex pattern |
|
||||
| `changeManagement/transportRequestLabel` | no | `TransportRequest\s?:` | regex pattern |
|
||||
| `changeManagement/git/format` | no | `%b` | see `git log --help` |
|
||||
| `changeManagement/type` | no | `SOLMAN` | `SOLMAN`, `CTS` |
|
||||
|
||||
* `script` - The common script environment of the Jenkinsfile running. Typically the reference to the script calling the pipeline step is provided with the `this` parameter, as in `script: this`. This allows the function to access the [`commonPipelineEnvironment`](commonPipelineEnvironment.md) for retrieving, for example, configuration parameters.
|
||||
* `changeDocumentId` - For type `SOLMAN` only. The id of the change document related to the transport request to release. Typically provided via commit history.
|
||||
* `transportRequestId` - The id of the transport request to release. Typically provided via commit history.
|
||||
* `applicationId` - For type `SOLMAN` only. The id of the application.
|
||||
* `filePath` - The path of the file to upload.
|
||||
* `changeManagement/credentialsId` - The credentials to connect to the service endpoint (Solution Manager, ABAP System).
|
||||
* `changeManagement/endpoint` - The service endpoint (Solution Manager, ABAP System).
|
||||
* `changeManagement/git/from` - The starting point for retrieving the change document id and/or transport request id
|
||||
* `changeManagement/git/to` - The end point for retrieving the change document id and/or transport request id
|
||||
* `changeManagement/changeDocumentLabel` - For type `SOLMAN` only. A pattern used for identifying lines holding the change document id.
|
||||
* `changeManagement/transportRequestLabel` - A pattern used for identifying lines holding the transport request id.
|
||||
* `changeManagement/type` Where/how the transport request is created (via SAP Solution Manager, ABAP).
|
||||
* `changeManagement/git/format` - Specifies what part of the commit is scanned. By default the body of the commit message is scanned.
|
||||
|
||||
## Step configuration
|
||||
## ${docGenConfiguration}
|
||||
|
||||
The step is configured using a customer configuration file provided as
|
||||
resource in an custom shared library.
|
||||
|
@ -65,6 +65,5 @@ markdown_extensions:
|
||||
extra_css:
|
||||
- 'css/extra.css'
|
||||
edit_uri: edit/master/documentation/docs
|
||||
docs_dir: docs-tmp
|
||||
site_dir: docs-gen
|
||||
repo_url: https://github.com/SAP/jenkins-library
|
||||
|
@ -1,16 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
PRIVATE_KEY="cfg/id_rsa"
|
||||
|
||||
chmod 600 "${PRIVATE_KEY}"
|
||||
eval `ssh-agent -s`
|
||||
ssh-add "${PRIVATE_KEY}"
|
||||
mkdir ~/.ssh
|
||||
chmod 700 ~/.ssh
|
||||
ssh-keyscan github.com >> ~/.ssh/known_hosts
|
||||
git config user.name "Travis CI Publisher"
|
||||
git remote add docu "git@github.com:$TRAVIS_REPO_SLUG.git";
|
||||
git fetch docu gh-pages:gh-pages
|
||||
echo "Pushing to gh-pages of repository $TRAVIS_REPO_SLUG"
|
||||
cd documentation
|
||||
mkdocs gh-deploy -v --clean --remote-name docu
|
@ -3,6 +3,7 @@ import static com.sap.piper.Prerequisites.checkScript
|
||||
import com.sap.piper.Utils
|
||||
import groovy.transform.Field
|
||||
|
||||
import com.sap.piper.GenerateDocumentation
|
||||
import com.sap.piper.ConfigurationHelper
|
||||
import com.sap.piper.cm.BackendType
|
||||
import com.sap.piper.cm.ChangeManagement
|
||||
@ -19,15 +20,60 @@ import static com.sap.piper.cm.StepHelpers.getBackendTypeAndLogInfoIfCMIntegrati
|
||||
@Field Set GENERAL_CONFIG_KEYS = STEP_CONFIG_KEYS
|
||||
|
||||
@Field Set STEP_CONFIG_KEYS = [
|
||||
'changeManagement'
|
||||
'changeManagement',
|
||||
/**
|
||||
* @see checkChangeInDevelopment
|
||||
* @parentConfigKey changeManagement
|
||||
*/
|
||||
'clientOpts',
|
||||
/**
|
||||
* @see checkChangeInDevelopment
|
||||
* @parentConfigKey changeManagement
|
||||
*/
|
||||
'credentialsId',
|
||||
/**
|
||||
* @see checkChangeInDevelopment
|
||||
* @parentConfigKey changeManagement
|
||||
*/
|
||||
'endpoint',
|
||||
/**
|
||||
* @see checkChangeInDevelopment
|
||||
* @parentConfigKey changeManagement
|
||||
*/
|
||||
'git/from',
|
||||
/**
|
||||
* @see checkChangeInDevelopment
|
||||
* @parentConfigKey changeManagement
|
||||
*/
|
||||
'git/to',
|
||||
/**
|
||||
* @see checkChangeInDevelopment
|
||||
* @parentConfigKey changeManagement
|
||||
*/
|
||||
'git/format',
|
||||
/**
|
||||
* @see transportRequestCreate
|
||||
* @parentConfigKey changeManagement
|
||||
*/
|
||||
'rfc/developmentInstance',
|
||||
/**
|
||||
* @see transportRequestCreate
|
||||
* @parentConfigKey changeManagement
|
||||
*/
|
||||
'rfc/developmentClient',
|
||||
]
|
||||
|
||||
@Field Set PARAMETER_KEYS = STEP_CONFIG_KEYS.plus([
|
||||
/** @see transportRequestCreate */
|
||||
'changeDocumentId',
|
||||
/** The id of the transport request to release. */
|
||||
'transportRequestId',
|
||||
/** @see transportRequestCreate */
|
||||
'verbose',
|
||||
])
|
||||
|
||||
/** Releases a Transport Request. */
|
||||
@GenerateDocumentation
|
||||
void call(parameters = [:]) {
|
||||
|
||||
handlePipelineStepErrors (stepName: STEP_NAME, stepParameters: parameters) {
|
||||
|
@ -3,6 +3,7 @@ import static com.sap.piper.Prerequisites.checkScript
|
||||
import com.sap.piper.Utils
|
||||
import groovy.transform.Field
|
||||
|
||||
import com.sap.piper.GenerateDocumentation
|
||||
import com.sap.piper.ConfigurationHelper
|
||||
import com.sap.piper.cm.ChangeManagement
|
||||
import com.sap.piper.cm.BackendType
|
||||
@ -17,25 +18,91 @@ import static com.sap.piper.cm.StepHelpers.getBackendTypeAndLogInfoIfCMIntegrati
|
||||
@Field def STEP_NAME = getClass().getName()
|
||||
|
||||
@Field Set GENERAL_CONFIG_KEYS = [
|
||||
'changeManagement'
|
||||
'changeManagement',
|
||||
/**
|
||||
* @see checkChangeInDevelopment
|
||||
* @parentConfigKey changeManagement
|
||||
*/
|
||||
'changeDocumentLabel',
|
||||
/**
|
||||
* Defines where the transport request is created, e.g. SAP Solution Manager, ABAP System.
|
||||
* @parentConfigKey changeManagement
|
||||
* @possibleValues `SOLMAN`, `CTS`, `RFC`
|
||||
*/
|
||||
'type',
|
||||
/**
|
||||
* @see checkChangeInDevelopment
|
||||
* @parentConfigKey changeManagement
|
||||
*/
|
||||
'clientOpts',
|
||||
/**
|
||||
* @see checkChangeInDevelopment
|
||||
* @parentConfigKey changeManagement
|
||||
*/
|
||||
'credentialsId',
|
||||
/**
|
||||
* @see checkChangeInDevelopment
|
||||
* @parentConfigKey changeManagement
|
||||
*/
|
||||
'endpoint',
|
||||
/**
|
||||
* @see checkChangeInDevelopment
|
||||
* @parentConfigKey changeManagement
|
||||
*/
|
||||
'git/from',
|
||||
/**
|
||||
* @see checkChangeInDevelopment
|
||||
* @parentConfigKey changeManagement
|
||||
*/
|
||||
'git/to',
|
||||
/**
|
||||
* @see checkChangeInDevelopment
|
||||
* @parentConfigKey changeManagement
|
||||
*/
|
||||
'git/format',
|
||||
/**
|
||||
* @see transportRequestCreate
|
||||
* @parentConfigKey changeManagement
|
||||
*/
|
||||
'rfc/developmentInstance',
|
||||
/**
|
||||
* @see transportRequestCreate
|
||||
* @parentConfigKey changeManagement
|
||||
*/
|
||||
'rfc/developmentClient',
|
||||
/**
|
||||
* A pattern used for identifying lines holding the transport request id.
|
||||
* @parentConfigKey changeManagement
|
||||
*/
|
||||
'changeManagement/transportRequestLabel'
|
||||
]
|
||||
|
||||
@Field Set STEP_CONFIG_KEYS = GENERAL_CONFIG_KEYS.plus([
|
||||
'applicationName', // RFC
|
||||
/** The id of the application. Only for `SOLMAN`.*/
|
||||
'applicationId', // SOLMAN
|
||||
'applicationDescription',
|
||||
/** The path of the file to upload.*/
|
||||
'filePath', // SOLMAN, CTS
|
||||
/** The URL where to find the UI5 package to upload to the transport request. Only for `RFC`. */
|
||||
'applicationUrl', // RFC
|
||||
/** The ABAP package name of your application. */
|
||||
'abapPackage',
|
||||
/** The code page of your ABAP system. E.g. UTF-8. */
|
||||
'codePage', //RFC
|
||||
'acceptUnixStyleLineEndings', // RFC
|
||||
/** @see transportRequestCreate */
|
||||
'verbose', // RFC
|
||||
])
|
||||
|
||||
@Field Set PARAMETER_KEYS = STEP_CONFIG_KEYS.plus([
|
||||
/** @see transportRequestCreate */
|
||||
'changeDocumentId',
|
||||
/** The id of the transport request to upload the file.*/
|
||||
'transportRequestId'])
|
||||
|
||||
/** Uploads a file to a Transport Request. */
|
||||
@GenerateDocumentation
|
||||
void call(parameters = [:]) {
|
||||
|
||||
handlePipelineStepErrors (stepName: STEP_NAME, stepParameters: parameters) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user