Skip to main content

Managing Releases with the CLI

This topic describes how to use the replicated CLI to create and promote releases.

Prerequisites

Before you create a release using the replicated CLI, complete the following prerequisites:

  • Install the replicated CLI. See Installing the replicated CLI.

  • Create a new application using the replicated app create APP_NAME command. You only need to do this procedure one time for each application that you want to deploy. See app create in Reference.

  • Set the REPLICATED_APP and REPLICATED_API_TOKEN environment variables. See Set the Environment Variables in Installing the replicated CLI.

    Example:

    export REPLICATED_APP=my-app-slug
    export REPLICATED_API_TOKEN=1234abcd
    note

    The token environment variable is valid for a single session. You must export it for each new session.

Create a Release From a Local Directory

You can use the replicated CLI to create a release from the local directory that contains your application files.

To create and promote a new release:

  1. (Helm Charts Only) If your release contains any Helm charts:

    1. For each Helm chart, package the chart and its dependencies into .tgz files:

      helm package . --dependency-update

      For more information, see Helm Package in the Helm documentation.

    2. Move the .tgz file or files to the local directory with your application files:

      mv CHART_TGZ PATH_TO_APP_DIR

      Replace:

      • CHART_TGZ with the .tgz Helm chart package.
      • PATH_TO_APP_DIR with path to the local directory with your application files.

      Example

      mv wordpress-1.3.5.tgz manifests
    3. (KOTS Only) If your release supports installation with Replicated KOTS, configure a HelmChart custom resource for each Helm chart in your release and add them to the local directory with your application files. See Configuring the HelmChart Custom Resource.

  2. Do one of the following:

    • Create and promote with one command:

      replicated release create --yaml-dir PATH_TO_APP_DIR --lint --promote CHANNEL

      Replace:

      • PATH_TO_APP_DIR with path to the local directory with your application files.
      • CHANNEL with the channel ID or the case sensitive name of the channel.
    • Create and edit before promoting:

      1. Lint the application manifest files and ensure that there are no errors in the YAML:

        replicated release lint --yaml-dir=PATH_TO_APP_DIR

        Replace PATH_TO_APP_DIR with path to the local directory with your application files.

        For more information about linting, see release lint and Linter Rules.

      2. Create a new release:

        replicated release create --yaml-dir PATH_TO_APP_DIR

        Replace PATH_TO_APP_DIR with path to the local directory with your application files.

        For more information, see release create or release update in Reference.

      3. Continue to edit and lint the release as needed, then update the release:

        replicated release update SEQUENCE --yaml-dir PATH_TO_APP_DIR

        Replace:

        • SEQUENCE with the release sequence number. This identifies the existing release to be updated.

        • PATH_TO_APP_DIR with path to the local directory with your application files.

          For more information, see release update in Reference.

      4. Promote the release when you are ready to test it. Releases cannot be edited after they are promoted. To make changes after promotion, you have to create a new release.

        replicated release promote SEQUENCE CHANNEL

        Replace:

        • SEQUENCE with the release sequence number.

        • CHANNEL with the channel ID or the case sensitive name of the channel.

          For more information, see release promote in the replicated CLI documentation.

  3. Verify that the release was promoted to the channel:

    replicated release ls

Create a Release With a Helm Chart Only

For applications that contain only a single Helm chart, you can use the --chart flag to add your Helm chart to a release. This prevents you from having to create a local directory with your Helm chart to create the release.

For releases that support installation with Replicated KOTS, see Create a Release From a Local Directory above.

To create a release for an application that contains a Helm chart:

  1. Package the chart and its dependencies into a .tgz file:

    helm package . --dependency-update

    For more information, see Helm Package in the Helm documentation.

  2. Create a release and promote it to the Unstable channel:

    replicated release create --chart=CHART_TGZ_FILE --promote=Unstable

    Replace CHART_TGZ_FILE with the .tgz Helm chart package. For example, --chart=my-chart-1.0.0.tgz.

    note

    As described in Create a Release from a Local Directory above, the --promote flag is optional.

  3. Verify that the release was promoted to the channel:

    replicated release ls