# Variables, secrets and jobs

> Set environment variables and encrypted secrets on an AirLift app, paste a whole .env file, and run jobs before or after each deployment.

Source: https://docs.phluit.com/products/airlift/variables-and-jobs/

## Environment variables and secrets

1.  Open your app and go to **Settings → Environment variables**.
2.  Click **Add variable**, enter the name and value, and tick **Encrypt** for passwords, keys and tokens. Encrypted values are never shown again, only replaced.
3.  Click **Save**. The app is deployed again with the new values.

To add many at once, click **Bulk edit**, paste plain variables one per line (like a `.env` file) and click **Use these**. Names that look like secrets are encrypted automatically.

**App-level** variables reach every component; a component's own variable with the same name wins. Every service also gets its port in the `PORT` variable.

**Download app spec** (under **Settings → App spec**) gives you the app's settings as JSON, without the encrypted values.

## Jobs

A job runs a command around a deployment, for example database migrations. Add one under **Settings → Components** with **Add component**, choose a job and pick **When it runs**:

-   **Before each deployment**: if it fails, the new version isn't released.
-   **After each deployment**.
-   **After a failed deployment**.

How many jobs you can have depends on your [plan](/products/airlift/plans-and-prices/).

AirLift has no scheduled (cron) jobs. For tasks on a timer, use a [Managed VM](/products/managed-vms/).
