Workspace Block

Workspace Block

The workspace block describes cache related information.

ℹ️
To leverage caching capabilities and enable fast builds on CI, you need to create an account on Insights. There you can create a workspace which can be used with Terrabuild.

Once you have created an account and a workspace on Insights, create a token to allow Terrabuild to use the specified workspace.

For this, issue the following command for your workspace:

terrabuild login --workspace <workspaceId> --token <token>

And voilà! Your builds will be faster!

⚠️
If you are connected to a workspace and would like to build without cache support, you can use the --local-only argument to ignore it.

Example Usage

workspace {
    id = "af628998-bd53-4063-b054-f0b87965edd4"
    ignores = [ "src/project-1" ]
    version = "0.174.0"
    engine = ~docker
    configuration = "local"
    environment = "dev"
}

Argument Reference

The following arguments are supported:

  • id - (Optional) Workspace Id.

  • ignores - (Optional) List of projects to ignore (globbings). Globbings are relative to workspace folder.

    Default value includes common build and dependency directories:

    [
        "node_modules"
        ".pnpm-store"
        ".terrabuild"
        "bin"
        "obj"
        "dist"
    ]

    These defaults ensure that common build artifacts and dependency directories are automatically excluded from project discovery.

  • version - (Optional) Minimal version requested (semantic versionning format). Default is none.

  • engine - (Optional) Container engine to use. Allowed values are: ~docker, ~podman and ~none. Default is ~docker.

  • configuration - (Optional) Configuration to use. Default is nothing.

  • environment - (Optional) Environment to use. Default is nothing.

Last updated on