publishArtifactVersion

Back to index

Summary

Publishes an artifact version to an artifact repository. This API wraps the publish function in the ElectricCommander::ArtifactManagement Perl module and hides some additional functionality implemented in that module.

You must specify an artifactName or a groupId with an artifactKey.

artifactName
Stringoptional
The name of an artifact.
artifactKey
Stringoptional
User-specified identifier for this artifact. This field is limited to alphanumeric characters, spaces, underscores, hyphens, and periods.
compress
Booleanoptional
Default is "true". Controls whether the artifact version is compressed during transport, which improves performance for cases where artifact version files are compressible, saving network bandwidth. Where artifact version files are not compressible, performance is reduced. Another consideration is that the artifact version is stored compressed/uncompressed based on this setting in the repository backing-store.
dependentArtifactVersions
Arrayoptional
One or more artifact version queries. The most current match of each query is retrieved when the primary artifact is retrieved. Dependent artifact version query strings are in this form: <groupId>:<artifactKey>:<versionRange> ( versionRange is optional). The version range syntax is standard number interval notation. () marks exclusive ranges and [] marks inclusive ranges.
description
Stringoptional
A plain text or HTML description for this object. If using HTML, you must surround your text with <html> … </html> tags. The only HTML tags allowed in the text are: <a> <b> <br> <div> <dl> <font> <i> <li> <ol> <p> <pre> <span> <style> <table> <tc> <td> <th> <tr> <ul>.
excludePatterns
Arrayoptional
Semicolon delimited list of file-path patterns indicating which files/directories under "fromDirectory" to exclude when publishing an artifact version. Defaults to "empty," which means no files are excluded.
followSymlinks
Booleanoptional

Default is "true". If true, follow symbolic links and record the target file contents with the symbolic link name in the artifact. If false, record the symbolic link as a symbolic link. Following symbolic links causes the publishing API to remain compatible with previous releases.

fromDirectory
Stringoptional
The directory containing files to publish as the artifact version. A subset of files can be published based on includePatterns and excludePatterns.
groupId
Stringoptional
A user-generated group name for this artifact. This field is limited to alphanumeric characters, spaces, underscores, hyphens, and periods.
includePatterns
Arrayoptional
Semicolon delimited list of file-path patterns indicating which files/directories under "fromDirectory" to publish in the artifact version. Defaults to "empty," which means all files will be included. Conversely, if only two files are "included," no other files except those two will be included.
repositoryName
Stringoptional
The name of the artifact repository where you want to publish.
version
Stringoptional

Unique identifier for the artifact version in the form: major.minor.patch-qualifier-buildNumber. major, minor, patch, and buildNumber are integers and qualifier can contain any character except the following: \:<>|?*/

If a version argument is provided, but does not follow the above format, the version will be considered 0.0.0-<user-specified-version-arg>-0 implicitly.

Usage

Perl

$cmdr->publishArtifactVersion( # optionals );

ectool

ectool publishArtifactVersion \ # optionals

Examples

Version number examples

User input

Interpretation

Major.Minor.Patch

Qualifier

Build Number

1

1.0.0

0

1.0

1.0.0

0

1.0-frank

1.0.0

frank

0

1.0-36

1.0.0

36

1.0-frank-36

1.0.0

frank

36

Pattern syntax

Include / exclude patterns are expressed as relative paths under the fromDirectory. Pattern syntax and behavior is the same as Ant and uses the following wildcard specifiers:

  • ? — matches a single character.

  • \* — matches any number of characters, but only at a single directory level.

  • *\* — matches any number of directory levels.

For example:

  • Use \*.txt to match any .txt file in the top-level directory.

  • Use */\*.txt to match any .txt file in any child directory.

  • Use *\*/\*.txt to match any .txt file at any level.

Perl

# Add version 1.0.0-55 for artifact myGroup:myKey with a dependency on cmdr:SDK:1.2.0, # and the most current version of core:infra that is greater than or equal to 2.1.0. # Note: In the Perl API, the argument must be specified as singular even though it # can take multiple values. $cmdr->publishArtifactVersion({artifactName => "myGroup:myKey", version => "1.0.0-55", dependentArtifactVersion => ["cmdr:SDK:1.2.0", "core:infra:{2.1,]"]});

ectool

ectool publishArtifactVersion --artifactName "myGroup:myKey" --version "1.0.0-55" --dependentArtifactVersion "cmdr:SDK:1.2.0":"core:infra"