runway.module.staticsite.options package

Runway Static Site Module options.

pydantic model runway.module.staticsite.options.RunwayStaticSiteExtraFileDataModel[source]

Bases: ConfigProperty

Model for Runway static site Module extra_files option item.

Show JSON schema
{
   "title": "Runway static site Module extra_files option item",
   "description": "Model for Runway static site Module extra_files option item.",
   "type": "object",
   "properties": {
      "content_type": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Content Type"
      },
      "content": {
         "default": null,
         "title": "Content"
      },
      "file": {
         "anyOf": [
            {
               "format": "path",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "File"
      },
      "name": {
         "title": "Name",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "name"
   ]
}

field content: Any = None

Inline content that will be used as the file content. This or file must be provided.

field content_type: str | None = None

An explicit content type for the file. If not provided, will attempt to determine based on the name provided.

field file: Path | None = None

Path to an existing file. The content of this file will be uploaded to the static site S3 bucket using the name as the object key. This or content must be provided.

field name: str = PydanticUndefined

The destination name of the file to create.

pydantic model runway.module.staticsite.options.RunwayStaticSiteModuleOptionsDataModel[source]

Bases: ConfigProperty

Model for Runway static site Module options.

Show JSON schema
{
   "title": "Runway static site Module options",
   "description": "Model for Runway static site Module options.",
   "type": "object",
   "properties": {
      "build_output": {
         "default": "./",
         "title": "Build Output",
         "type": "string"
      },
      "build_steps": {
         "default": [],
         "items": {
            "type": "string"
         },
         "title": "Build Steps",
         "type": "array"
      },
      "extra_files": {
         "default": [],
         "items": {
            "$ref": "#/$defs/RunwayStaticSiteExtraFileDataModel"
         },
         "title": "Extra Files",
         "type": "array"
      },
      "pre_build_steps": {
         "default": [],
         "items": {
            "$ref": "#/$defs/RunwayStaticSitePreBuildStepDataModel"
         },
         "title": "Pre Build Steps",
         "type": "array"
      },
      "source_hashing": {
         "$ref": "#/$defs/RunwayStaticSiteSourceHashingDataModel",
         "default": {
            "directories": [
               {
                  "exclusions": [],
                  "path": "."
               }
            ],
            "enabled": true,
            "parameter": null
         }
      }
   },
   "$defs": {
      "RunwayStaticSiteExtraFileDataModel": {
         "additionalProperties": false,
         "description": "Model for Runway static site Module extra_files option item.",
         "properties": {
            "content_type": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Content Type"
            },
            "content": {
               "default": null,
               "title": "Content"
            },
            "file": {
               "anyOf": [
                  {
                     "format": "path",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "File"
            },
            "name": {
               "title": "Name",
               "type": "string"
            }
         },
         "required": [
            "name"
         ],
         "title": "Runway static site Module extra_files option item",
         "type": "object"
      },
      "RunwayStaticSitePreBuildStepDataModel": {
         "additionalProperties": false,
         "description": "Model for Runway static site Module pre_build_steps option item.",
         "properties": {
            "command": {
               "title": "Command",
               "type": "string"
            },
            "cwd": {
               "default": "/home/docs/checkouts/readthedocs.org/user_builds/runway/checkouts/stable/docs/source",
               "format": "path",
               "title": "Cwd",
               "type": "string"
            }
         },
         "required": [
            "command"
         ],
         "title": "Runway static site Module pre_build_steps option item",
         "type": "object"
      },
      "RunwayStaticSiteSourceHashingDataModel": {
         "additionalProperties": false,
         "description": "Model for Runway static site Module source_hashing option.",
         "properties": {
            "directories": {
               "default": [
                  {
                     "exclusions": [],
                     "path": "."
                  }
               ],
               "items": {
                  "$ref": "#/$defs/RunwayStaticSiteSourceHashingDirectoryDataModel"
               },
               "title": "Directories",
               "type": "array"
            },
            "enabled": {
               "default": true,
               "title": "Enabled",
               "type": "boolean"
            },
            "parameter": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Parameter"
            }
         },
         "title": "Runway static site Module source_hashing option",
         "type": "object"
      },
      "RunwayStaticSiteSourceHashingDirectoryDataModel": {
         "additionalProperties": false,
         "description": "Model for Runway static site Module source_hashing.directory option item.",
         "properties": {
            "exclusions": {
               "default": [],
               "items": {
                  "type": "string"
               },
               "title": "Exclusions",
               "type": "array"
            },
            "path": {
               "format": "path",
               "title": "Path",
               "type": "string"
            }
         },
         "required": [
            "path"
         ],
         "title": "Runway static site Module source_hashing.directories option item",
         "type": "object"
      }
   }
}

field build_output: str = './'

Directory where build output is placed. Defaults to current working directory.

field build_steps: list[str] = []

List of commands to run to build the static site.

field extra_files: list[RunwayStaticSiteExtraFileDataModel] = []

List of files that should be uploaded to S3 after the build. Used to dynamically create or select file.

field pre_build_steps: list[RunwayStaticSitePreBuildStepDataModel] = []

Commands to be run prior to the build process.

field source_hashing: RunwayStaticSiteSourceHashingDataModel = RunwayStaticSiteSourceHashingDataModel(directories=[RunwayStaticSiteSourceHashingDirectoryDataModel(exclusions=[], path=PosixPath('.'))], enabled=True, parameter=None)

Overrides for source hash calculation and tracking.

pydantic model runway.module.staticsite.options.RunwayStaticSitePreBuildStepDataModel[source]

Bases: ConfigProperty

Model for Runway static site Module pre_build_steps option item.

Show JSON schema
{
   "title": "Runway static site Module pre_build_steps option item",
   "description": "Model for Runway static site Module pre_build_steps option item.",
   "type": "object",
   "properties": {
      "command": {
         "title": "Command",
         "type": "string"
      },
      "cwd": {
         "default": "/home/docs/checkouts/readthedocs.org/user_builds/runway/checkouts/stable/docs/source",
         "format": "path",
         "title": "Cwd",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "command"
   ]
}

field command: str = PydanticUndefined

The command to run.

field cwd: Path = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/runway/checkouts/stable/docs/source')

The working directory for the subprocess running the command. If not provided, the current working directory is used.

pydantic model runway.module.staticsite.options.RunwayStaticSiteSourceHashingDataModel[source]

Bases: ConfigProperty

Model for Runway static site Module source_hashing option.

Show JSON schema
{
   "title": "Runway static site Module source_hashing option",
   "description": "Model for Runway static site Module source_hashing option.",
   "type": "object",
   "properties": {
      "directories": {
         "default": [
            {
               "exclusions": [],
               "path": "."
            }
         ],
         "items": {
            "$ref": "#/$defs/RunwayStaticSiteSourceHashingDirectoryDataModel"
         },
         "title": "Directories",
         "type": "array"
      },
      "enabled": {
         "default": true,
         "title": "Enabled",
         "type": "boolean"
      },
      "parameter": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Parameter"
      }
   },
   "$defs": {
      "RunwayStaticSiteSourceHashingDirectoryDataModel": {
         "additionalProperties": false,
         "description": "Model for Runway static site Module source_hashing.directory option item.",
         "properties": {
            "exclusions": {
               "default": [],
               "items": {
                  "type": "string"
               },
               "title": "Exclusions",
               "type": "array"
            },
            "path": {
               "format": "path",
               "title": "Path",
               "type": "string"
            }
         },
         "required": [
            "path"
         ],
         "title": "Runway static site Module source_hashing.directories option item",
         "type": "object"
      }
   },
   "additionalProperties": false
}

field directories: list[RunwayStaticSiteSourceHashingDirectoryDataModel] = [RunwayStaticSiteSourceHashingDirectoryDataModel(exclusions=[], path=PosixPath('.'))]

Explicitly provide the directories to use when calculating the hash. If not provided, will default to the root of the module.

field enabled: bool = True

Enable source hashing. If not enabled, build and upload will occur on every deploy.

field parameter: str | None = None

SSM parameter where the hash of each build is stored.

pydantic model runway.module.staticsite.options.RunwayStaticSiteSourceHashingDirectoryDataModel[source]

Bases: ConfigProperty

Model for Runway static site Module source_hashing.directory option item.

Show JSON schema
{
   "title": "Runway static site Module source_hashing.directories option item",
   "description": "Model for Runway static site Module source_hashing.directory option item.",
   "type": "object",
   "properties": {
      "exclusions": {
         "default": [],
         "items": {
            "type": "string"
         },
         "title": "Exclusions",
         "type": "array"
      },
      "path": {
         "format": "path",
         "title": "Path",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "path"
   ]
}

field exclusions: list[str] = []

List of gitignore formmated globs to ignore when calculating the hash.

field path: Path = PydanticUndefined

Path to files to include in the hash.

class runway.module.staticsite.options.StaticSiteOptions[source]

Bases: ModuleOptions

Static site options.

build_output

Directory where build output is placed. Defaults to current working directory.

build_steps

List of commands to run to build the static site.

data

Options parsed into a data model.

extra_files

List of files that should be uploaded to S3 after the build. Used to dynamically create or select file.

pre_build_steps

Commands to be run prior to the build process.

source_hashing

Overrides for source hash calculation and tracking.

__init__(data: RunwayStaticSiteModuleOptionsDataModel) None[source]

Instantiate class.

classmethod parse_obj(obj: object) StaticSiteOptions[source]

Parse options definition and return an options object.

Parameters:

obj – Object to parse.