Publish a package to the Platform

Publishing your package to the ActiveState catalog allows the Platform to build the package and make it available to everyone in your organization. This is currently only available for Linux users.

Ensure the following conditions are met before you begin

  • The State Tool is installed
  • Your State Tool is authorized
  • You have a .tar file of the source code of your package

The following will walk you through the process of


Publishing your proprietary package using the command line

To publish to the ActiveState Platform

  • Open a command terminal and enter the directory containing your package’s source code. If the file is not currently stored as a .tar file, convert it to a tar file
  • Open a text editor and create a configuration file containing the code sample shown below and save it to your working directory
    • The contents of this file will be pasted as a command into your terminal
    • Save this information somewhere on your system for verification and documentation
state publish \ 
--namespace private/<orgname>/<language> \
--name <package-name> \
--version <version-number> \
--description "<package-description>" \
--author "name <<email>> \ 
--depend "<builder/python-module-builder@>=0>" \
--feature language/<language>/<package-name>@<version-number> \
<file-name>
  • Replace placeholder values in the angled brackets with the details from your package (note the double angled brackets around email, one set must remain in the final code)
    • file-name, namespace, package-name, version-number and builder dependency with the --depend flag are all necessary for a successful publication.
  • Depending on the active requests sent to the Platform and available resources, this may take 10 mins for your package to be available
  • If your package contains more than one dependency, add as many as needed by writing additional --depend lines
State publish \ 
--namespace private/MyOrg/python \
–-name MyPackage \
–- version 1.0.0 \
--description "This package provides utility functions" \
–-author "John Smith <jsmith@email.com> \ 
--depend "MyOrg/MyPackage@1.0.0" \ 
--feature language/python/MyPackage@1.0.0
MyPackage.tar.gz

After completing the file and saving it to your system, copy the contents of the file and paste it into your command line. This will publish your package to the ActiveState Platform.

Wait for a confirmation message in your terminal, you may be prompted to confirm your request. Press y to confirm.


Publishing your proprietary package using a yaml file

To publish to the ActiveState Platform using your project’s .yaml file

  • Open a command terminal and enter the directory containing your package’s source code. If the file is not currently stored as a .tar file, convert it to a tar file
  • Open a text editor and create a configuration file containing the code sample shown below and save it to your working directory
    • The contents of this file will be pasted as a command into your terminal. Save this file somewhere on your system for verification and documentation.
name: <package-name>
namespace: private/<orgname>/<language>
version: "<version-number>"
description: <package-description>
authors:
    - name: <author-name>
      email: <author-email>
dependencies:
    - dependency:
        name: <dependency-name>
        namespace: <dependency-namespace>
        versionRequirements: '>=0'
features:
    - name: <package-name>
      namespace: private/<orgname>/<language>
      version: "<version-number>"
  • Replace placeholder values in the angled brackets with the details from your project/package
  • Depending on the active requests sent to the Platform and available resources, this may take 10 mins for your package to be available
  • If your package contains more than one dependency, add as many as needed by writing additional --depend lines
    - dependency:
        name: <dependency-name>
        namespace: <dependency-namespace>
        versionRequirements: '>=0'

A complete example .yaml file is shown below

name: libunistring-demo
namespace: private/ActiveStateBE/shared
version: "1.0.0"
description: Unicode string library
authors:
    - name: John Smith
      email: jsmith@email.org
dependencies:
    - dependency:
        name: autotools-builder
        namespace: builder
        versionRequirements: '>=0'
features:
    - name: libunistring-demo
      namespace: shared
      version: "1.0.0"

After completing the file and saving it to your working directory, enter the following into your command line to publish the package to the ActiveState Platform

state publish --meta <yaml-file>.yaml <package-file>

For example

state publish --meta my-project.yaml TAR_FILE.tar.gz

Using your newly published package in your project

Your package is now available on the ActiveState Platform. To install your package to your local system, either create a secure shell environment using

state shell <orgname>/<projectname>

Or begin using a previously checked-out project by entering

state use <orgname>/<projectname>

Install the newly published package to the runtime environment by entering

state install <package-name>

Your package is now installed to your project and available to use. Note that publishing a new package may cause other packages in your project to be rebuilt, leading to a longer build time.