1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00
sap-jenkins-library/resources/metadata/tmsUpload.yaml
gerstneralex f5c33d51bb
Tms export (#4160)
* Change parameter type of nodeExtDescriptorMapping

(cherry picked from commit ca7ce0485a)

* Remove usage of the depricated ioutil package

(cherry picked from commit 9821915b33)

* Fix cmd failure if neither git/commitId nor customDescription are
provided

(cherry picked from commit c362681e45)

* Fix unit test

(cherry picked from commit 53a90aabb5)

* Step metadata, step code generation

* change type of nodeExtDescriptorMapping for export

* Refactoring and export implementation

* integration test

* Add export step

* Integration test

* format

* discard piper.go

* Review related changes

* restore piper.go

* remove unused method

* Extend documentation

* Add parameter useGoStep to tmsUpload.groovy

* Regenerate steps

* Rename function

* refactor constants

* Add error path tests

* Move some code to tms package

* Move more code to tms

* Combine tmsUpload, tmsUtils

* Add groovy wrapper

* add parameters to groovy step

* add import

* jenkinsUtils instance

* comment namedUser logic in groovy

* namedUser param

* remove logic for namedUser param

* Remove TMS integration tests

* discard changes in tmsUpload.groovy

* Remove parameters

* Restore parameters

* Change type of NodeExtDescriptorMapping to map[string]interface{}

* tmsUpload: Change type of NodeExtDescriptorMapping to map

* Resolve ioutil deprecation

* Review related changes

* Formatting

* Review related improvements

* Add tmsUtils test

* Formatting tmsUtils_test

* Remove parameters from groovy wrapper

* Remove tmsUtils_test

* Add TMS steps to fieldRelatedWhitelist

* Add integration test

* Add test to github_actions_integration_test_list.yml

* Move test helper method

* Step documentation placeholder

* Remove parameter StashContent

* Restore cmd/integrationArtifactTransport.go

---------

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
2023-03-27 16:55:29 +02:00

111 lines
5.5 KiB
YAML

metadata:
name: tmsUpload
description: This step allows you to upload an MTA file (multi-target application archive) and multiple MTA extension descriptors into a TMS (SAP Cloud Transport Management service) landscape for further TMS-controlled distribution through a TMS-configured landscape.
longDescription: |-
This step allows you to upload an MTA file (multi-target application archive) and multiple MTA extension descriptors into a TMS (SAP Cloud Transport Management service) landscape for further TMS-controlled distribution through a TMS-configured landscape. The MTA file is attached to a new transport request which is added directly to the import queue of the specified transport node.
TMS lets you manage transports between SAP Business Technology Platform accounts in Neo and Cloud Foundry, such as from DEV to TEST and PROD accounts.
For more information, see [official documentation of SAP Cloud Transport Management service](https://help.sap.com/viewer/p/TRANSPORT_MANAGEMENT_SERVICE)
!!! note "Prerequisites"
* You have subscribed to and set up TMS, as described in [Initial Setup](https://help.sap.com/viewer/7f7160ec0d8546c6b3eab72fb5ad6fd8/Cloud/en-US/66fd7283c62f48adb23c56fb48c84a60.html), which includes the configuration of a node to be used for uploading an MTA file.
* A corresponding service key has been created, as described in [Set Up the Environment to Transport Content Archives directly in an Application](https://help.sap.com/viewer/7f7160ec0d8546c6b3eab72fb5ad6fd8/Cloud/en-US/8d9490792ed14f1bbf8a6ac08a6bca64.html). This service key (JSON) must be stored as a secret text within the Jenkins secure store or provided as value of tmsServiceKey parameter.
spec:
inputs:
secrets:
- name: credentialsId
description: Jenkins 'Secret text' credentials ID containing service key for SAP Cloud Transport Management service.
type: jenkins
resources:
- name: buildResult
type: stash
params:
- name: tmsServiceKey
type: string
description: Service key JSON string to access the SAP Cloud Transport Management service instance APIs. If not specified and if pipeline is running on Jenkins, service key, stored under ID provided with credentialsId parameter, is used.
scope:
- PARAMETERS
- STEPS
- STAGES
mandatory: true
secret: true
resourceRef:
- name: credentialsId
type: secret
param: tmsServiceKey
- name: customDescription
type: string
description: Can be used as the description of a transport request. Will overwrite the default, which is corresponding Git commit ID.
scope:
- PARAMETERS
- STEPS
- STAGES
resourceRef:
- name: commonPipelineEnvironment
param: git/commitId
- name: namedUser
type: string
description: Defines the named user to execute transport request with. The default value is 'Piper-Pipeline'. If pipeline is running on Jenkins, the name of the user, who started the job, is tried to be used at first.
default: Piper-Pipeline
scope:
- PARAMETERS
- STEPS
- STAGES
- name: nodeName
type: string
description: Defines the name of the node to which the *.mtar file should be uploaded.
scope:
- PARAMETERS
- STEPS
- STAGES
mandatory: true
- name: mtaPath
type: string
description: Defines the relative path to *.mtar file for the upload to the SAP Cloud Transport Management service. If not specified, it will use the *.mtar file created in mtaBuild.
scope:
- PARAMETERS
- STEPS
- STAGES
resourceRef:
- name: commonPipelineEnvironment
param: mtarFilePath
- name: mtaVersion
type: string
description: Defines the version of the MTA for which the MTA extension descriptor will be used. You can use an asterisk (*) to accept any MTA version, or use a specific version compliant with SemVer 2.0, e.g. 1.0.0 (see semver.org). If the parameter is not configured, an asterisk is used.
default: "*"
scope:
- PARAMETERS
- STEPS
- STAGES
- name: nodeExtDescriptorMapping
type: map[string]interface{}
description: 'Available only for transports in Cloud Foundry environment. Defines a mapping between a transport node name and an MTA extension descriptor file path that you want to use for the transport node, e.g. nodeExtDescriptorMapping: {"nodeName": "example.mtaext", "nodeName2": "example2.mtaext"}.'
scope:
- PARAMETERS
- STEPS
- STAGES
- name: proxy
type: string
description: Proxy URL which should be used for communication with the SAP Cloud Transport Management service backend.
scope:
- PARAMETERS
- STEPS
- STAGES
- name: stashContent
type: '[]string'
description: 'If specific stashes should be considered during Jenkins execution, their names need to be passed as a list via this parameter, e.g. stashContent: ["deployDescriptor", "buildResult"]. By default, the build result is considered.'
default: ["buildResult"]
scope:
- PARAMETERS
- STEPS
- STAGES
outputs:
resources:
- name: influx
type: influx
params:
- name: step_data
fields:
- name: tms
type: bool