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: pathlib.Path, directories: Optional[List[Dict[str, Union[str, List[str]]]]] = 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: pathlib.Path, additional_exclusions: Optional[List[str]] = None) igittigitt.igittigitt.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.