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/nexusUpload.yaml

137 lines
4.8 KiB
YAML
Raw Normal View History

metadata:
name: nexusUpload
aliases:
- name: mavenExecute
deprecated: false
description: Upload artifacts to Nexus Repository Manager
longDescription: |
Upload build artifacts to a Nexus Repository Manager.
Supports MTA, npm and (multi-module) Maven projects.
MTA files will be uploaded to a Maven repository.
The uploaded file-type depends on your project structure and step configuration.
To upload Maven projects, you need a pom.xml in the project root and set the mavenRepository option.
To upload MTA projects, you need a mta.yaml in the project root and set the mavenRepository option.
To upload npm projects, you need a package.json in the project root and set the npmRepository option.
npm:
Publishing npm projects makes use of npm's "publish" command.
It requires a "package.json" file in the project's root directory which has "version" set and is not delared as "private".
To find out what will be published, run "npm publish --dry-run" in the project's root folder.
It will use your gitignore file to exclude the mached files from publishing.
Note: npm's gitignore parser might yield different results from your git client, to ignore a "foo" directory globally use the glob pattern "**/foo".
If an image for mavenExecute is configured, and npm packages are to be published, the image must have npm installed.
spec:
inputs:
secrets:
- name: nexusCredentialsId
description: Jenkins 'Username with password' credentials ID containing the technical username/password credential for accessing the nexus endpoint.
type: jenkins
aliases:
- name: nexus/credentialsId
params:
- name: version
type: string
description: The Nexus Repository Manager version. Currently supported are 'nexus2' and 'nexus3'.
scope:
2020-08-31 16:10:28 +02:00
- PARAMETERS
- STAGES
- STEPS
mandatory: false
default: nexus3
possibleValues:
- nexus2
- nexus3
aliases:
- name: nexus/version
- name: url
type: string
description: URL of the nexus. The scheme part of the URL will not be considered, because only http is supported.
scope:
2020-08-31 16:10:28 +02:00
- PARAMETERS
- STAGES
- STEPS
mandatory: true
aliases:
- name: nexus/url
- name: mavenRepository
type: string
description: Name of the nexus repository for Maven and MTA deployments. If this is not provided, Maven and MTA deployment is implicitly disabled.
scope:
- PARAMETERS
- STAGES
- STEPS
aliases:
- name: nexus/mavenRepository
- name: nexus/repository
deprecated: true
- name: npmRepository
type: string
description: Name of the nexus repository for npm deployments. If this is not provided, npm deployment is implicitly disabled.
scope:
- PARAMETERS
- STAGES
- STEPS
aliases:
- name: nexus/npmRepository
- name: groupId
type: string
description: Group ID of the artifacts. Only used in MTA projects, ignored for Maven.
scope:
2020-08-31 16:10:28 +02:00
- PARAMETERS
- STAGES
- STEPS
aliases:
- name: nexus/groupId
- name: artifactId
type: string
description: The artifact ID used for both the .mtar and mta.yaml files deployed for MTA projects, ignored for Maven.
scope:
2020-08-31 16:10:28 +02:00
- PARAMETERS
- name: globalSettingsFile
type: string
description: Path to the mvn settings file that should be used as global settings file.
scope:
- GENERAL
- PARAMETERS
- STAGES
- STEPS
aliases:
- name: maven/globalSettingsFile
- name: m2Path
type: string
description: The path to the local .m2 directory, only used for Maven projects.
scope:
- GENERAL
- PARAMETERS
- STAGES
- STEPS
aliases:
- name: maven/m2Path
- name: username
type: string
description: Username for accessing the Nexus endpoint.
scope:
2020-08-31 16:10:28 +02:00
- PARAMETERS
2020-04-16 14:37:45 +02:00
secret: true
resourceRef:
- name: nexusCredentialsId
type: secret
param: username
- name: password
type: string
description: Password for accessing the Nexus endpoint.
scope:
2020-08-31 16:10:28 +02:00
- PARAMETERS
2020-04-16 14:37:45 +02:00
secret: true
resourceRef:
- name: nexusCredentialsId
type: secret
param: password
containers:
# To allow both maven and mta we require an image that contains both tools. If the user configures an image for mavenExecute that also needs to contain both.
- name: mvn-npm
image: devxci/mbtci:1.0.4