Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

Add airnode-deployer rollback command #1170

Merged
merged 2 commits into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions docs/airnode/v0.10/grp-providers/docker/deployer-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ they exist.
- [deploy](./deployer-image.md#deploy)
- [list](./deployer-image.md#list)
- [info](./deployer-image.md#info)
- [rollback](./deployer-image.md#rollback)
- [fetch-files](./deployer-image.md#fetch-files)
- [remove](./deployer-image.md#remove)
- [remove-with-receipt](./deployer-image.md#remove-with-receipt)
Expand Down Expand Up @@ -248,6 +249,45 @@ docker run -it --rm ^

::::

### `rollback`

In case you want to revert to one of the previous versions of your deployment,
you can do so with the [rollback](../../reference/packages/deployer.md#rollback)
command. You need to provide the deployment ID from the
[list](./deployer-image.md#list) command above to specify what deployment you
want to revert. You also need to provide the deployment version ID from the
[info](./deployer-image.md#info) command above to specify the deployment version
to which you want to revert. The
[rollback](../../reference/packages/deployer.md#rollback) command will then
fetch your configuration files of the specified version and **deploy a new
version** with the same configuration. You can check this with the
[info](./deployer-image.md#info) command above.

:::: tabs

::: tab Linux/Mac/WSL2

```sh
docker run -it --rm \
-v "$(pwd):/app/config" \
api3/airnode-deployer:0.10.0 rollback aws2c6ef2b3 3580a278
```

:::

::: tab Windows

```batch
# For Windows, use CMD (not PowerShell).
docker run -it --rm ^
-v "%cd%:/app/config" ^
api3/airnode-deployer:0.10.0 rollback aws2c6ef2b3 3580a278
```

:::

::::

### `fetch-files`

During the Airnode deployment, your `config.json` and `secrets.env` are uploaded
Expand Down
34 changes: 30 additions & 4 deletions docs/airnode/v0.10/reference/packages/deployer.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ stage, Airnode version and the update history.
# Displays info about deployed Airnode

Positionals:
deployment-id ID of the deployment (from 'list' command) [string] [required]
deployment-id ID of the deployment to show info for (from 'list' command) [string] [required]

Options:
--version Show version number [boolean]
Expand All @@ -217,6 +217,32 @@ Options:
airnode-deployer info aws2c6ef2b3
```

### Reverting to a previous version

In case you want to revert to one of the previous versions of your deployment,
you can do so with the `rollback` command.

#### rollback

```bash
# Deploy one of the previous Airnode deployment versions

Positionals:
deployment-id ID of the deployment to rollback (from 'list' command) [string] [required]
version-id ID of the deployment version to rollback to (from 'info' command) [string] [required]

Options:
--version Show version number [boolean]
--debug Run in debug mode [boolean] [default: false]
--help Show help [boolean]
-r, --receipt Output path for receipt file [string] [default: "config/receipt.json"]
-l, --logs Output path for log files [string] [default: "config/logs/"]
--auto-remove Enable automatic removal of deployed resources for failed deployments [boolean] [default: true]

# Example
airnode-deployer rollback aws808e2a22 5bbcd317
```

### Fetching deployment files

During the Airnode deployment, your `config.json` and `secrets.env` are uploaded
Expand All @@ -229,8 +255,8 @@ retrieve them.
# Fetch deployment files for the deployed Airnode

Positionals:
deployment-id ID of the deployment (from 'list' command) [string] [required]
version-id ID of the deployment version (from 'info' command) [string]
deployment-id ID of the deployment to fetch files for (from 'list' command) [string] [required]
version-id ID of the deployment version to fetch files for (from 'info' command) [string]

Options:
--version Show version number [boolean]
Expand Down Expand Up @@ -259,7 +285,7 @@ An Airnode can be removed in two different ways:
# Removes a deployed Airnode instance

Positionals:
deployment-id ID of the deployment (from 'list' command) [string] [required]
deployment-id ID of the deployment to remove (from 'list' command) [string] [required]

Options:
--version Show version number [boolean]
Expand Down