uptainer.git

class uptainer.git.Git(log: BoundLoggerLazyProxy, remote_url: str, branch: str, ssh_private_key: str)[source]

Bases: object

__init__(log: BoundLoggerLazyProxy, remote_url: str, branch: str, ssh_private_key: str) None[source]

Wrapper for all git function like clone, push, etc.

Parameters:
  • log (BoundLoggerLazyProxy) – Log class to inject into the vars. Class: structlog

  • remote_url (str) – Remote git url, that needs to starts with ssh:// or git@

  • branch (str) – Working git branch to use.

  • ssh_private_key (str) – Private key to use for pull and push data

Returns:

None

clone_repo() TyperGenericReturn[source]

Clone the repo provided in the temporary dir and switch to the branch.

Parameters:

None

Returns:

Return a dict that contain a boolean value for the errors.

create_workdir() str[source]

Create a working directory under TMPDIR (platform based) and set it as workdir.

Parameters:

None

Returns:

Work Directory path created (str)

push_repo(fpath: str, newversion: str) TyperGenericReturn[source]

Push the new changes into git.

Parameters:
  • fpath (str) – RELATIVE path of the file to push.

  • newversion (str) – New version to apply, needed for the commit msg.

Returns:

TyperGenericReturn Object