# Deployer
The airnode-deployer (opens new window) package is used primarily by the Docker Images. This CLI tool provides the underlying commands used by the Docker images when deploying an Airnode.
Deploying an Airnode
API providers are strongly encouraged to use the Docker Images when deploying an Airnode and not the deployer CLI commands.
# Usage
The deployer's commands can be run using npx (opens new window), installing a global npm package or by manually building the airnode-deployer package. Using npx is the simplest method to interact with the deployer manually if you do not wish to use the Docker images.
# Using npx
The airnode-deployer package can be run as an npm package using npx. This allows you to run deployer commands without installing the deployer npm package or having to manually build the airnode-deployer package yourself.
npx @api3/airnode-deployer deploy --config pathTo/config.json --secrets pathTo/secrets.env --receipt myOutput/receipt.json
# Global Package
The airnode-deployer package can be installed globally with yarn or npm. If
installed using yarn make sure yarn bin is added to PATH
.
yarn global add @api3/airnode-deployer
# OR
npm install @api3/airnode-deployer -g
# Executing the deployer.
airnode-deployer deploy --config pathTo/config.json --secrets pathTo/secrets.env --receipt myOutput/receipt.json
2
3
4
5
6
# Examples
The deployer has two commands. To re-deploy an existing Airnode run the deploy
command again.
# Workflows
- Make sure you have
config.json
andsecrets.env
ready. Then, use thedeploy
command to trigger your first deployment. - In order to update the Airnode configuration:
- Update the
config.json
andsecrets.env
files as needed. - Run the
deploy
command again.
- Update the
- Use the
remove
command to remove the Airnode deployment. Use the-r
option to provide the receipt file from the latest deployment or manually add the required arguments.
# deploy
When creating or updating an Airnode the config.json
and secrets.env
files
are needed. You can use the provided example
config.json (opens new window)
and
secrets.env (opens new window)
templates to get started quickly, but you will need to edit these with your own
API details and secrets.
Warning about simultaneous deployments
Avoid running multiple deployments simultaneously as doing so might result in a broken deployment. If this occurs, the standard removal approach may not succeed and Manual Removal may be required.
Make sure config.json
and secrets.env
are available in the path for the
--configuration
argument.
When completed the deploy
command creates a receipt using the path and name
from the --receipt
argument. The receipt contains metadata about the
deployment and can be used to remove the Airnode.
# Deploys an Airnode instance using the `config.json` and `secrets.env` files.
# This can be used for a new deployment or to update an existing deployment.
Options:
--version Show version number [boolean]
--debug Run in debug mode [boolean] [default: false]
--help Show help [boolean]
-c, --configuration, --config, --conf Path to configuration file [string] [default: "config/config.json"]
-s, --secrets Path to secrets file [string] [default: "config/secrets.env"]
-r, --receipt Output path for receipt file [string] [default: "output/receipt.json"]
# Example
airnode-deployer deploy --config pathTo/config.json --secrets pathTo/secrets.env --receipt myOutput/receipt.json
2
3
4
5
6
7
8
9
10
11
12
13
# remove
An Airnode can be removed using the remove command two different ways.
- Best: With a deployment receipt created when the Airnode was deployed.
- Alternate: With the Airnode short address and cloud provider
specifications. The
airnodeShortAddress
is used in the cloud console within the names of the serverless functions. The other values can be found inconfig.json
.nodeSetting.cloudProvider.type
nodeSetting.cloudProvider.region
nodeSetting.cloudProvider.projectId
(GCP only)nodeSetting.stage
# Removes a deployed Airnode instance.
Options:
--version Show version number [boolean]
--debug Run in debug mode [boolean] [default: false]
--help Show help [boolean]
-r, --receipt Path to receipt file [string]
-a, --airnode-address-short Airnode Address (short version) [string]
-s, --stage Stage (environment) [string]
-c, --cloud-provider Cloud provider [choices: "aws", "gcp"]
-e, --region Region [string]
-p, --project-id Project ID (GCP only) [string]
# Examples
airnode-deployer remove --receipt myOutput/receipt.json
airnode-deployer remove --airnode-address-short abd9eaa --stage dev --cloud-provider aws --region us-east-1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16