Project configuration

Add common build and runtime configuration
An Airplane Project can be optionally configured with an airplane.yaml configuration file. If included, the airplane.yaml file must be located in the root directory of the project. We recommend always placing an airplane.yaml configuration file at the root of your project.
Copied
1
support-tools/ ⭐ PROJECT ROOT
2
┣ helpers/
3
┃ ┗ utils.ts
4
┣ customers.json
5
┣ my_task.airplane.ts
6
┣ package.json
7
┗ airplane.yaml ✅ INSIDE PROJECT
Copied
1
repo/
2
┣ support-tools/ ⭐ PROJECT ROOT
3
┃ ┣ helpers/
4
┃ ┃ ┗ utils.ts
5
┃ ┣ my_task.airplane.ts
6
┃ ┗ package.json
7
┗ airplane.yaml 🚫 OUTSIDE PROJECT
Use the airplane.yaml file to configure common build and runtime options for all of the tasks and views in the project.

Reference

JavaScript

These options are applied to all JavaScript tasks in the project.
Top-level field under which you can specify configuration for all JavaScript tasks in the project.
yaml
Copied
1
javascript:
2
nodeVersion: "18"
3
envVars:
4
API_KEY:
5
config: STRIPE_API_KEY
javascript.nodeVersion
enum
default: 18
Possible Values
"14"
"16"
"18"
The version of Node.js that the tasks should be executed with.
This field is optional, but highly recommended. If it is not included, tasks will be run with the latest version of Node.js that Airplane supports (currently Node.js 18) and automatically be upgraded when Airplane supports a new version of Node.js
Environment variables that will be passed into all of the JavaScript tasks in the project.
Environment variables can be entered directly ("from value"), or you can reference Config variables ("from config variable"). Use config variables for secrets and/or values you want to share across multiple tasks.
Example:
yaml
Copied
1
javascript:
2
envVars:
3
# From value
4
NODE_ENV:
5
value: production
6
# From config variable
7
MY_SECRET:
8
config: MY_SECRET_CONFIG_VAR
You can also specify environment variables on a per-task basis rather than for an entire project. While per-task environment variables only apply at run-time, project-level environment variables in your airplane.yaml apply at run-time and build-time.
A custom script that overrides the default install command.
Example:
yaml
Copied
1
javascript:
2
install: "yarn install --non-interactive --frozen-lockfile"
A custom script run before dependency installation during deployment.
Example:
yaml
Copied
1
javascript:
2
preinstall: yarn run generate
A custom script run after dependency installation during deployment.
Example:
yaml
Copied
1
javascript:
2
postinstall: yarn run generate
Possible Values
slim
full
The base image that the tasks are built with.
The slim image should be preferred as it is faster and lighter-weight. It contains the minimum packages needed to run a JavaScript Airplane task.
If your tasks use packages that are not included in the slim image (such as git), you can instead select the full image.
If your tasks use inline task configuration, the base defaults to slim. Other tasks default to full.

Python

These options are applied to all Python tasks in the project.
python
object
Top-level field under which you can specify configuration for all Python tasks in the project.
yaml
Copied
1
python:
2
version: "3.10"
3
envVars:
4
API_KEY:
5
config: STRIPE_API_KEY
python.version
enum
default: 3.10
Possible Values
3.7
3.8
3.9
3.10
3.11
The version of Python that the tasks are executed with.
This field is optional, but highly recommended. If it is not included, tasks will be run with the default of Python (currently Python 3.10) and automatically be upgraded when Airplane changes its default.
Environment variables that will be passed into all of the Python tasks in the project.
Environment variables can be entered directly ("from value"), or you can reference Config variables ("from config variable"). Use config variables for secrets and/or values you want to share across multiple tasks.
Example:
yaml
Copied
1
python:
2
envVars:
3
# From value
4
NODE_ENV:
5
value: production
6
# From config variable
7
MY_SECRET:
8
config: MY_SECRET_CONFIG_VAR
You can also specify environment variables on a per-task basis rather than for an entire project. While per-task environment variables only apply at run-time, project-level environment variables in your airplane.yaml apply at run-time and build-time.
A custom script run before dependency installation during deployment.
Example:
yaml
Copied
1
python:
2
preinstall: echo "before install"
A custom script run after dependency installation during deployment.
Example:
yaml
Copied
1
python:
2
postinstall: echo "after install"
Possible Values
slim
full
The base image that the tasks are built with.
The slim image should be preferred as it is faster and lighter-weight. It contains the minimum packages needed to run a Python Airplane task.
If your tasks use packages that are not included in the slim image (such as git), you can instead select the full image.
If your tasks use inline task configuration, the base defaults to slim. Other tasks default to full.

Views

These options are applied to all views in the project.
view
object
Top-level field under which you can specify configuration for all views in the project.
yaml
Copied
1
view:
2
envVars:
3
API_KEY:
4
config: STRIPE_API_KEY
Environment variables that will be passed into all of the views in the project.
Environment variables can be entered directly ("from value"), or you can reference Config variables ("from config variable"). Use config variables for values you want to share across multiple views.
Note that environment variables can be seen in the View source code in the browser, so anybody with access to the view can see the value of the environment variable. Environment variables prefixed with BUILD_ will not be included in the View source code and can only be used at build time.
If you need to use a secret in a view, we recommend pulling business logic that requires the secret into a task and and using a task environment variable.
Example:
yaml
Copied
1
view:
2
envVars:
3
# From value
4
MY_URL:
5
value: "https://airplane.dev"
6
# From config variable
7
MY_CONFIG:
8
config: MY_CONFIG_VAR
You can also specify environment variables on a per-view basis rather than for an entire project. While per-view environment variables only apply at run-time, project-level environment variables in your airplane.yaml apply at run-time and build-time.