API
Generator
Generate index page with links to all previously archived folders during a tag build
- class lightweight_versioned_gitlab_pages.generate.TagInfo(tag: gitlab.v4.objects.tags.ProjectTag, commit: gitlab.v4.objects.commits.ProjectCommit, created_at: datetime.datetime, job_id: int = -1, pages_url: str = '', job_ids: List[Dict[str, int]] = <factory>)[source]
Bases:
object
- lightweight_versioned_gitlab_pages.generate.create_html_files(tag_list: List[TagInfo], path: Path, template: Optional[Path] = None) None [source]
Create all HTML files.
- Parameters
tag_list (List[TagInfo]) – The tag list
path (Path) – The path to the output folder
template (Optional[Path]) – Path to custom template file
- lightweight_versioned_gitlab_pages.generate.create_output_directory(path: Path) None [source]
Create the output directory.
- Parameters
path (Path) – The path to the output directory
- lightweight_versioned_gitlab_pages.generate.get_artifact_url(web_url: str, job_id: int, folder: str, index_file: str) str [source]
Create the artifact URL.
- lightweight_versioned_gitlab_pages.generate.get_pipeline_job(project: Project, tag_info: TagInfo, job_name: str, web_url: str) None [source]
Get the pipeline job informations and set the tag info values.
- lightweight_versioned_gitlab_pages.generate.get_project(url: str, private_token: str, project_id: int) Project [source]
Get the GitLab project.
- lightweight_versioned_gitlab_pages.generate.get_project_tags(project: Project, job_name: str, web_url: str) List[TagInfo] [source]
Get all project tags.
- lightweight_versioned_gitlab_pages.generate.get_template_file(file_name: str, template_folder: Optional[Path] = None) Template [source]
Get the Jinja2 template file.
- Parameters
file_name (str) – The template file name
template_folder (Path) – The template folder
- Returns
The template.
- Return type
Template
- lightweight_versioned_gitlab_pages.generate.parse_arguments() Namespace [source]
Parse CLI arguments. :raise argparse.ArgumentError Argparse error :return: argparse object
- lightweight_versioned_gitlab_pages.generate.parser_valid_file(parser: ArgumentParser, arg: str) Path [source]
Determine whether file exists.
- Parameters
parser (parser object) – The parser
arg (str) – The file to check
- Raises
argparse.ArgumentError – Argument is not a file
- Returns
Input file path, parser error is thrown otherwise.
- Return type
Path