publish

Use this command to publish packages.

Purpose

The publish command is used to publish a package to the library server, or to update a package on the library server. To publish a package, a package descriptor file must be available. A package descriptor file describes a single package, which corresponds to one asset in Rational® Asset Manager.

Parameters

You can use the publish command with no arguments, with a compressed file, or with a location. Additionally, you can specify the configuration file on the command line.
Argument Description Required
-o Use the -o parameter to overwrite an existing package on the library server. No
(no argument supplied) The package descriptor must be in the current directory. All files in the current directory are uploaded as artifacts to the asset on the library server. If the current directory does not contain a package descriptor, then all subdirectories are searched for a package descriptor. Each subdirectory that contains a package descriptor is treated as a package to publish. No
compressed_file The package must be compressed in the .zip format. The package descriptor must be in the root folder in the compressed file. The compressed file is extracted, and then the files in the archive are uploaded as artifacts to the asset on the library server. No
pathname The package descriptor must be in the root of the location. All files in the location are uploaded as artifacts to the asset on the library server. If the location does not contain a package descriptor, then all subdirectories are searched for a package descriptor. Each subdirectory that contains a package descriptor is treated as a package to publish. You can use this parameter to publish several packages at a time. Note that packages cannot be defined inside other packages. No
-c component_name:component_value The name and version of a component package to create on the library server. A component package represents all of the packages uploaded by the publish command. No
-id build_ID The value to substitute for the SNAPSHOT variable when publishing. No
-config configuration_file The complete path to the configuration file to use for communication with the library server. If you do not specify a configuration file on the command line, the default configuration file in the .ram subdirectory in the home directory of the current user is used. No, as long as the default configuration file exists in the .ram subdirectory of the home directory of the current user.

Package descriptor syntax

A package is a collection of files. Application deliverables, installation scripts, and documentation can all be packages. The command-line interface recognizes the JSON file package.json as the package descriptor. The command-line interface also recognizes Maven pom.xml and .pom files as package descriptors, but if multiple package descriptors are available for any package, the package.json file takes precedence. The package descriptor must include id and version parameters for the package. Other parameters in the package descriptor are optional. If you publish by using a Maven POM file as the package descriptor, the groupId parameter from the POM file is created as a the Group.Id attribute on the asset.

id
The package ID must be unique.
version
The package version is handled using semantic versioning rules. To learn more about semantic versioning rules, see Semantic Versioning. You can also use the reserved word SNAPSHOT to indicate the timestamp of the current build. For example, the version 1.0.0-SNAPSHOT would be expanded to 1.0.0-20101120-1700 if the most current build ran on November 20th, 2010 at 5pm.
description
A textual description of the package is optional.
owners
The owners parameter is an array of people described using the following format:
{   "name" : "Simone Dray",
	  "email" : "simdray@example.com",
	  "url" : "http://simdray.example.com"
}
You can also use a shortened version of the information, as in the following example: "Simone Dray <simdray@example.com> (http://simdray.example.com)". In either format, the email and url parameters are optional. If you do not specify an owners parameter, the owner of the published asset is set to the user specified in the configuration file.
type
The type parameter is used to set the asset type in Rational Asset Manager. If you do not specify a type parameter, a type parameter of Implementation is assumed.
dependencies
The dependencies parameter is an array of information that describes other packages on which this package depends. The package ID is required. A version number or query string are optional. To search for an asset in a particular state, use state:(state_name) for the query string. To search for an ID, use id:(ID) for the query string. You can also use a Rational Asset Manager search shortcut as the query string, for example: ramSearch:(1txt%2Ckeyword). You can get search shortcuts by clicking the View search shortcut icon after searching in Rational Asset Manager.
The following table shows how Maven POM file parameters map to the package.json file parameters.
package.json file parameter Maven POM file parameter
id artifactId
version version
description description
type Not applicable. When you publish using a POM file, the type is set to Implementation.
owners contributor
dependencies Not applicable.

Example package.json file

{
  "id": "jke",
  "version": "2.1.0-SNAPSHOT",
  "description": "Provides checking account services.",
  "owners" :  [
      { "name" : "Bill Jordan", "email" : "bjordan@example.com" } ,
      { "name" : "Lisa Starky", "email" : "lstarky@example.com" }
  ],
  "type" : "implementation",
  "dependencies": [
      { "id" : "JKE_infra", "version" : "2.1-SNAPSHOT" } ,
      { "id" : "devops_cookbooks-3.0", "query" : "state:(ready for verification)" }
  ]
}
ram publish newpackage.zip

Feedback