Deploy Options

Catalyst CLI enables you to deploy only specific resources, such as just the client package, specific functions, or the API Gateway rules, using two deploy options. The following options are available for the catalyst deploy command.

Note: Besides these deploy options, you can also deploy specific resources from your project by navigating to the target folder where the resources are located and executing the catalyst deploy command from that folder. This can be used when the deployable resources are all located in the same directory. For example, if you want to deploy a particular function alone, you can navigate to the function's folder in the CLI and run the catalyst deploy command.

--only <targets>

The --only option allows you to define the specific resources to be deployed. You can use this with client , functions , or apig keywords. You can specify multiple resources separated by commas without any whitespace characters between them.

For example, to deploy just the client directory, run the following command in your terminal:

copy
$
catalyst deploy --only client

This initiates the deployment of the client directory alone. The deployment process is the same as discussed in the previous section.


You can also deploy a specific function or functions using the --only option. You must specify the names of the target functions in the command separated by commas as shown below:

copy
$
catalyst deploy --only functions:InvoiceFetch,functions:CostAccounting

You can also deploy the client and certain functions, or API Gateway rules and certain functions, alone as shown below:

copy
$
catalyst deploy --only functions:InvoiceSync,functions:CostAccounting,functions:FreightTracking

This will deploy only the specified resources from the project directory.

Deploy Options


--except <targets>

The --except option allows you to define the resources to be excluded from deployment. It will deploy all the resources except for the ones that you specify.

For example, if you use the --except option with client , it will deploy only the functions directory and the API Gateway rules. You can execute this command in the following way:

copy
$
catalyst deploy --except client

You can also use this option to exclude specific functions. For example:

copy
$
catalyst deploy --except functions:InvoiceFetch,functions:PaymentStatusCheck,functions:CostAccounting

This will deploy all the other functions, the client, and the API Gateway rules.

Deploy Options


--ignore-scripts

Catalyst enables you to automate the CLI and terminal command executions by defining scripts in the catalyst.json file in your project directory. You can define two lifecycle scripts to execute before and after the catalyst deploy command respectively: predeploy, postdeploy. You can learn more about the lifecycle and custom scripts from the Scripts help page .

If you use the --ignore-scripts option while executing the catalyst deploy command, the CLI will ignore the actions configured for the predeploy and postdeploy scripts in the catalyst.json file of your project directory. The deployment process will proceed without the execution of these lifecycle scripts.

You can use the --ignore-scripts option as follows:

copy
$
catalyst deploy --ignore-scripts

The deployment process will be the same as discussed earlier.

Note: If you are a Visual Studio Code IDE user, you can install the Catalyst Tools extension, and perform CLI operations using your IDE in place of the CLI. Steps to individually deploy Catalyst functions using Visual Studio Code IDE can be found here, and steps to deploy client resources can be found here.

Last Updated 2024-01-09 17:07:13 +0530 +0530