1. Content Hub CLI

Use the Content Hub CLI for deployment automation

To use the Content Hub CLI for package-based CI/CD deployment automation, follow this workflow:

  1. Install the Content Hub CLI
  2. Log in with the CLI
  3. Initialize your working folder
  4. Export packages from the source environment
  5. Import packages into the target environment

The following list shows examples of common calls used in deployment automation. Replace package.zip with a valid file name.


# See available types - the list mirrors the one available in the portal
ch-cli system export --help

# Export a single type and wait for the response - this command runs until the package is completed and downloaded.
ch-cli system export --type EntityDefinitions --out package.zip

# Export multiple types and wait for the response.
ch-cli system export --type EntityDefinitions --type Scripts --out package.zip

# Async export that only initiates the job, but won't wait for completion (multiple types are possible as well). Adding `--order-id` returns the Order ID.
ch-cli system export --type EntityDefinitions --order-id

# Import is simpler, but always requires either a V1 or V2 package.
ch-cli system import --source package.zip --wait

# Async import
ch-cli system import --source package.zip --job-id
Note

To help you use the Content Hub CLI for deployment automation, we provide an example using an Azure pipeline. Refer to the general best practices for guidance. Migrate changes between instances contains additional information about migrating data.

If you have suggestions for improving this article, let us know!