Squadbase logo

Environments

Managing deployment environments in Squadbase

What are Environments?

Environments let you manage separate runtime configurations for your projects. By maintaining distinct production and preview environments, you can develop and deploy safely without affecting live users.

Key Features

  • Production: The live environment serving real users
  • Preview: A sandbox for testing and previewing changes
  • Per-environment settings: Manage domains, environment variables, and deployment configurations independently
  • Automatic deployments: Deploy automatically via branch tracking

To conserve cloud resources, deployments generated from commits are automatically deleted after 7 days. Environments linked to branches (like Preview and Production) are not automatically deleted.

How to Access

Access environment settings

Editor > Settings > Environments > [Environment name]

Enable Developer Mode from the "..." menu in the top-right corner of the editor.


System Environments

Squadbase automatically provides two system environments.

Production

Description: The primary environment serving real users

Characteristics:

  • Name and description cannot be modified
  • Cannot be deleted
  • Branch tracking settings can be customized
  • Analytics tracks access to this environment

Preview

Description: A testing and preview environment

Characteristics:

  • System-provided environment
  • Test new features without impacting production

Environment Settings

General Settings

Environment Name:

  • Cannot be changed for system environments
  • Editable for custom environments

Description:

  • Describes the environment's purpose
  • Cannot be changed for system environments

Branch Tracking

Automatically trigger deployments when pushing to specific Git branches.

Enable Branch Tracking

Toggle the Branch Tracking switch on.

Set Condition

Select the condition type:

  • "Branch is": Trigger when commits are pushed to a specific branch

Select Branch

Choose the target branch from the dropdown:

  • main - For production deployments
  • develop - For development environments
  • Or any custom branch

Once configured, pushing to the selected branch will automatically start a deployment!

Note for Production: Since it's a system environment, only branch tracking settings can be modified.


Domain Settings

Configure custom domains for each environment.

Current Domain

The currently assigned domain is displayed as a clickable link.

  • Example: limited-muscular-most-psychiatrist.squadbase.app

Changing the Subdomain

Editable portion:

https://[subdomain].squadbase.app

Constraints:

  • Minimum 3 characters
  • Only alphanumeric characters and hyphens allowed
  • Cannot start or end with a hyphen

Steps:

  1. Edit the subdomain portion
  2. Click the "Save" button

Deployment Settings

Auto-Generated Settings

This is the default configuration.

In most cases, auto-generated settings work perfectly. Click "Edit" to review or modify settings if needed.

Framework Settings

  • Framework: The framework in use (e.g., Django, Next.js)
  • Provider: Deployment provider (e.g., AWS)

Build Settings

  • Runtime: Execution environment (Python version, etc.)
  • Package Manager: Package manager (e.g., uv, npm)
  • Entrypoint: Application entrypoint
  • Dockerfile Path: Path to Dockerfile (when using Docker)
  • Build Context: Build context path
  • Build Arguments: Build arguments (JSON format)

AWS Settings

Region:

  • Example: Asia Pacific (Tokyo)

Memory:

  • Configured in MB
  • Adjust based on your application's requirements

Timeout:

  • Configured in seconds
  • Maximum request processing time

Provisioned Concurrency:

  • Pre-allocate concurrent executions
  • Reduces cold start latency

Ephemeral Storage:

  • Configured in MB
  • Temporary file storage capacity

Advanced Settings

Default settings typically work fine.

Root Directory Path:

  • Default: . (current directory)

Settings File Path:

  • Default: ./squadbase.yml
  • Can specify a custom configuration file

Environment Variables

Securely manage sensitive data and application configuration.

Managing Environment Variables

Displayed information:

  • Variable name
  • Value (masked by default)
  • Date added
  • Added by

Actions:

  • Update button: Add or edit environment variables
  • Show button: Reveal masked values
  • Action menu next to each variable

Common Environment Variables

GOOGLE_SERVICE_ACCOUNT_JSON_BASE64
BIGQUERY_PROJECT_ID
DATABASE_URL
API_KEY
SECRET_KEY

Security Note: Environment variables are masked by default since they may contain sensitive information.


Tips & FAQ


Best Practices

  1. Start with auto-generated settings: They work well for most use cases
  2. Use different environment variables per environment: Configure separate API keys and database URLs for Production and Preview
  3. Leverage branch tracking: Automate deployments to streamline your workflow
  4. Be mindful of resources: Oversized memory and timeout settings can increase costs—use only what you need

Summary

Environments help you separate production and testing workloads, enabling safe and efficient development. Combined with branch tracking and environment variables, you can automate and optimize your deployment workflow.

For additional help, refer to the "Help" or "Documentation" links within the application.