Deploy Using the CLI
This guide goes over deploying your environment using the Coalesce coa
CLI tool.
Before You Begin
Make sure you have the following setup before deploying using coa
.
- Install
coa
by following the instructions in CLI Setup. - You need to have a Git Repository with your pipeline information added.
Environment Configured
Step 1: Open Your Repository
You need to be in the correct repository with the commit you want to deploy before moving onto step 2.
Step 2: Create a Plan
This step assumed you've installed coa
.
Before you can deploy, you need to create a plan. The plan details the environment, Snowflake credentials, and what will be deployed. You can create the plan as many times as needed before you deploy. It is based on the repo/branch and the environment configuration.
Run coa plan
. This will generate a coa-plan.json
. Open the file to review the plan information.
-
Review the
targetEnvironment
, this is the environment where the deploy will happen. You can see the environment ID in multiple locations:-
The UI by going to Build Settings> Environments. The environment IDs are 2 and 6 in this example.
-
Get a List of Environments using the API.
-
The environment ID is set by either:
- Hardcoding the information in the
.coa
file - Setting it manually in the command line.
coa plan --environmentID 6
. You can also override the.coa
file by using the command line.
- Hardcoding the information in the
-
-
You can also review
plan
object, which includes tables that have been deleted, added, or altered. You can also see jobs, parameters, macros, and other deployment information.- If you want to change the
plan
object, make your edits in the Coalesce app then update your local branch. We don't recommend updating the plan file directly.
- If you want to change the
Review the CLI Commands for a full list of command line options.
Step 3: Deploy Your Plan
Run coa deploy
.This will execute the plan you just created.
Review the Deploy Status
You can review the deploy status by:
-
Going to the run in Coalesce App and clicking on the deploy.
-
If you're using the cli, adding the
--out
flag to print the results in JSON format. -
Using the API, List Run Results, using the
runID
. The run ID is listed in the deploy information.