Local task execution

Execute your tasks locally before deploying to Airplane.

The Airplane CLI can be used to test your tasks locally before deploying to Airplane. If you haven't installed the CLI, do that before continuing.

Not all tasks support local execution. Currently, only Node, Python and shell tasks support local execution.

To execute your task locally:

bash
Copied
1
$ airplane dev path/to/definition.task.yaml

If your task has any parameters, you'll be prompted:

bash
Copied
1
$ airplane dev my_task.task.yaml
2
? Dry Run (--dry_run): [Use arrows to move, type to filter]
3
> Yes
4
No

These inputs can also be passed as CLI args:

bash
Copied
1
$ airplane dev my_task.task.yaml -- --help
2
3
Test Task Usage:
4
--dry_run (default: true)
5
6
$ airplane dev my_task.task.yaml -- --dry_run=false

Environment Variables

The airplane dev command will load any environment variables declared in a .env or airplane.env when executing your task.

For example, if you had two tasks (task_a and task_b) with the following directory layout:

Copied
1
tasks/
2
├── airplane.env
3
├── package.json
4
├── task_a.js
5
└── task_b/
6
├── airplane.env
7
└── task_b.js
8
9
# tasks/airplane.env
10
DB_URL=postgres://shareddb
11
12
# tasks/task_b/airplane.env
13
STRIPE_API_KEY=abcd
14
DB_URL=postgres://stripedb

When task A is run, it will have access to the shareddb DB URL in its environment. For task B, it will have access to the a STRIPE_API_KEY and the stripedb DB URL.