runway.cfngin.hooks.staticsite.utils module

Utility functions for website build/upload.

runway.cfngin.hooks.staticsite.utils.calculate_hash_of_files(files: Iterable[StrPath], root: Path) str[source]

Return a hash of all of the given files at the given root.

Parameters:
  • files – file names to include in the hash calculation, relative to root.

  • root – base directory to analyze files in.

Returns:

A hash of the hashes of the given files.

runway.cfngin.hooks.staticsite.utils.get_hash_of_files(root_path: Path, directories: list[dict[str, list[str] | str | None]] | None = None) str[source]

Generate md5 hash of files.

Parameters:
  • root_path – Base directory where all paths will be relative to. This should already be resolve to an absolute path.

  • directories – List of mappings that describe the paths to hash and files to exclude.

runway.cfngin.hooks.staticsite.utils.get_ignorer(path: Path, additional_exclusions: list[str] | None = None) IgnoreParser[source]

Create gitignore filter from directory .gitignore file.

Parameters:
  • path – Top-level directory that the gitignore filter will be created for. This directory and it’s subdirectories will be searched for .gitignore files to use.

  • additional_exclusions – Additional gitignore patterns to add.