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. Seeapp create
in Reference.Set the
REPLICATED_APP
andREPLICATED_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=1234abcdnoteThe 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:
(Helm Charts Only) If your release contains any Helm charts:
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.
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
(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.
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:
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.
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.
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.
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.
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:
Package the chart and its dependencies into a
.tgz
file:helm package . --dependency-update
For more information, see Helm Package in the Helm documentation.
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.noteAs described in Create a Release from a Local Directory above, the
--promote
flag is optional.Verify that the release was promoted to the channel:
replicated release ls