nexusUpload¶
Upload artifacts to Nexus Repository Manager
Description¶
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.
Usage¶
We recommend to define values of step parameters via config.yml file. In this case, calling the step is reduced to one simple line.
Calling the step can be done either via the Jenkins library step or on the command line.
Jenkins pipelines¶
nexusUpload script: this
Command line¶
piper nexusUpload
Parameters¶
Overview¶
Name | Mandatory | Additional information |
---|---|---|
nexusCredentialsId | yes | |
script | yes | |
url | yes | |
artifactId | no | |
containerCommand | no | |
containerShell | no | |
dockerEnvVars | no | |
dockerImage | no | |
dockerName | no | |
dockerOptions | no | |
dockerPullImage | no | |
dockerVolumeBind | no | |
dockerWorkspace | no | |
globalSettingsFile | no | |
groupId | no | |
m2Path | no | |
mavenRepository | no | |
npmRepository | no | |
password | no | |
user | no | |
verbose | no | activates debug output |
version | no |
Details¶
artifactId¶
The artifact ID used for both the .mtar and mta.yaml files deployed for MTA projects, ignored for Maven.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | $PIPER_artifactId (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
containerCommand¶
Jenkins-specific: Used for proper environment setup.
Kubernetes only: Allows to specify start command for container created with dockerImage parameter to overwrite Piper default (/usr/bin/tail -f /dev/null).
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
containerShell¶
Jenkins-specific: Used for proper environment setup.
Allows to specify the shell to be executed for container with containerName.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerEnvVars¶
Jenkins-specific: Used for proper environment setup.
Environment variables to set in the container, e.g. [http_proxy: "proxy:8080"].
Scope | Details |
---|---|
Aliases | - |
Type | map[string]string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerImage¶
Jenkins-specific: Used for proper environment setup.
Name of the docker image that should be used. If empty, Docker is not used and the command is executed directly on the Jenkins system.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerName¶
Jenkins-specific: Used for proper environment setup.
Kubernetes only: Name of the container launching dockerImage. SideCar only: Name of the container in local network.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerOptions¶
Jenkins-specific: Used for proper environment setup.
Docker options to be set when starting the container.
Scope | Details |
---|---|
Aliases | - |
Type | []string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerPullImage¶
Jenkins-specific: Used for proper environment setup.
Set this to 'false' to bypass a docker image pull. Usefull during development process. Allows testing of images which are available in the local registry only.
Scope | Details |
---|---|
Aliases | - |
Type | bool |
Mandatory | no |
Default | false |
Possible values | - true - false |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerVolumeBind¶
Jenkins-specific: Used for proper environment setup.
Volumes that should be mounted into the docker container.
Scope | Details |
---|---|
Aliases | - |
Type | map[string]string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerWorkspace¶
Jenkins-specific: Used for proper environment setup.
Kubernetes only: Specifies a dedicated user home directory for the container which will be passed as value for environment variable HOME
.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
globalSettingsFile¶
Path to the mvn settings file that should be used as global settings file.
Scope | Details |
---|---|
Aliases | maven/globalSettingsFile |
Type | string |
Mandatory | no |
Default | $PIPER_globalSettingsFile (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
groupId¶
Group ID of the artifacts. Only used in MTA projects, ignored for Maven.
Scope | Details |
---|---|
Aliases | nexus/groupId |
Type | string |
Mandatory | no |
Default | $PIPER_groupId (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
m2Path¶
The path to the local .m2 directory, only used for Maven projects.
Scope | Details |
---|---|
Aliases | maven/m2Path |
Type | string |
Mandatory | no |
Default | $PIPER_m2Path (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
mavenRepository¶
Name of the nexus repository for Maven and MTA deployments. If this is not provided, Maven and MTA deployment is implicitly disabled.
Scope | Details |
---|---|
Aliases | - nexus/mavenRepository - nexus/repository (deprecated) |
Type | string |
Mandatory | no |
Default | $PIPER_mavenRepository (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
nexusCredentialsId¶
Jenkins-specific: Used for proper environment setup.
The technical username/password credential for accessing the nexus endpoint.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | yes |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
npmRepository¶
Name of the nexus repository for npm deployments. If this is not provided, npm deployment is implicitly disabled.
Scope | Details |
---|---|
Aliases | nexus/npmRepository |
Type | string |
Mandatory | no |
Default | $PIPER_npmRepository (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
password¶
Password for accessing the Nexus endpoint.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | $PIPER_password (if set) |
Secret | yes |
Configuration scope |
|
Resource references | none |
script¶
Jenkins-specific: Used for proper environment setup.
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
for retrieving, e.g. configuration parameters.
Scope | Details |
---|---|
Aliases | - |
Type | Jenkins Script |
Mandatory | yes |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
url¶
URL of the nexus. The scheme part of the URL will not be considered, because only http is supported.
Scope | Details |
---|---|
Aliases | nexus/url |
Type | string |
Mandatory | yes |
Default | $PIPER_url (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
user¶
Username for accessing the Nexus endpoint.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | $PIPER_user (if set) |
Secret | yes |
Configuration scope |
|
Resource references | none |
verbose¶
verbose output
Scope | Details |
---|---|
Aliases | - |
Type | bool |
Mandatory | no |
Default | false |
Possible values | - true - false |
Secret | no |
Configuration scope |
|
Resource references | none |
version¶
The Nexus Repository Manager version. Currently supported are 'nexus2' and 'nexus3'.
Scope | Details |
---|---|
Aliases | nexus/version |
Type | string |
Mandatory | no |
Default | nexus3 |
Possible values | - nexus2 - nexus3 |
Secret | no |
Configuration scope |
|
Resource references | none |