COBOLget
COBOLget

COBOL Package Manager

Package Management

The Registry helps you distribute and integrate COBOL libraries into your projects by using cobolget, an open-source command-line tool. You can transparently integrate packages from GitHub, GitLab or Gitee repositories, written in gnucobol, entcobol or netcobol COBOL dialects. As well as public packages, the Registry lets you import your own private packages making COBOL code shared within your Organization only. You can manage Teams and Team Tokens granting per-team installation rights for a limited period of time.

COBOLget

In contrast to other Package Managers, COBOLget only analyzes Manifest files in cobolget format and does not clone nor crawl origin source-code. Package installation will fail if the maintainer decides restrict access to the repository or revoke the Team Token.

Using Packages

To start using cobolget in your project you need the Manifest file which describes the project and its dependencies.

$ npm install -g cobolget
$ cobolget init
Manifest modules.json created.

Now you can add a dependency which delivers additional functionality:

$ cobolget add core-datetime
Dependency 'core-datetime' has been added to the manifest.

By default, cobolget takes the latest version indexed on the Registry and adds it into modules.json.

$ cobolget update
Lockfile modules-lock.json updated.

The tool resolves direct and inherited dependencies in the Manifest and creates the Lockfile which contains exact versions of the packages. Keeping modules-lock.json under a version control is important to re-install the same dependencies in other environments, e.g. Continuous Integration.

Let's install the dependencies:

$ cobolget install
Downloading core-datetime 1.0.3
modules/core-datetime
modules/core-datetime/LICENSE
modules/core-datetime/README.md
modules/core-datetime/modules.json
modules/core-datetime/src/
modules/core-datetime/src/datetime.cbl
modules/core-datetime/tests/
modules/core-datetime/tests/datetime-test.cbl
modules/core-datetime/tests/modules.cpy
Copybook modules.cpy updated.

Directory modules contains source-code from core-datetime package and modules.cpy, a Copybook with all COBOL modules ready for inclusion into your project.

For installing a private package you need the Team Token from your Organization:

$ cobolget add core-network
$ cobolget update
$ cobolget -t bca12d6c4efed0627c87f2e576b72bdb5ab88e34 install

Publishing Packages

To start using cobolget in your library you need the Manifest file which describes the library and its dependencies.

$ npm install -g cobolget
$ cobolget init

Open modules.json in text editor, fix default values and validate the Manifest:

$ cobolget validate

Make sure, that in your Manifest

Commit and push modules.json to your repository. After release, you can import the package into the Registry by a link:

$ cobolget index https://gitlab.com/OlegKunitsyn/core-datetime

New releases of the package you can index by a name:

$ cobolget index core-datetime

For indexing private packages you must submit Repository Token to associate a package with the Organization. Follow GitLab or GitHub instructions. In the example below Organization is cobolget, but use your own.

$ cobolget -t DMNZpM9LzMyvswqE6yzz -o cobolget index https://gitlab.com/OlegKunitsyn/core-network

Versioning

COBOLget implements SemVer versioning standard. You can specify constraints in the Manifest to satisfy concrete versions of the dependencies.

Operator Constraint Example
* Any (default) "core-string": "*"
< Less than "core-string": "<1.0.2"
<= Less or equal to "core-string": "<=1.0.2"
> Greater than "core-string": ">1.0.2"
>= Greater or equal to "core-string": ">=1.0.2"
= Equal "core-string": "=1.0.2"
x Stand in "core-string": "1.0.x"
~ Approximately equal to "core-string": "~1.0.1"
© COBOLget 2020 · API Documentation · Terms and Conditions · Privacy Policy