GitLab

GitLab is a gitlab resource plugin for pydolphinscheduler.

When using a gitlab resource plugin, you only need to add the resource_plugin parameter in the task subclass or workflow definition, such as resource_plugin=GitLab(prefix=”xxx”), if it is a public repository.

If it is a private or Internal repository, you can use three ways to obtain authentication.

The first is Personal Access Tokens, using resource_plugin=GitLab(prefix=”xxx”, private_token=”xxx”).

The second method is to obtain authentication through username and password:

using resource_plugin=GitLab(prefix=”xxx”, username=”username”, password=”pwd”).

The third method is to obtain authentication through OAuth Token:

using resource_plugin=GitLab(prefix=”xxx”, oauth_token=”xx”).

You can view this document when creating a Personal Access Tokens.

For the specific use of resource plugins, you can see How to use in ResourcePlugin

Dive Into

DolphinScheduler gitlab resource plugin.

class pydolphinscheduler.resources_plugin.gitlab.GitLab(prefix: str, private_token: str | None = None, oauth_token: str | None = None, username: str | None = None, password: str | None = None, *args, **kwargs)[source]

Bases: ResourcePlugin, Git

GitLab object, declare GitLab resource plugin for task and workflow to dolphinscheduler.

Parameters:
  • prefix – A string representing the prefix of GitLab.

  • private_token – A string used for identity authentication of GitLab private or Internal repository.

  • oauth_token – A string used for identity authentication of GitLab private or Internal repository.

  • username – A string representing the user of the repository.

  • password – A string representing the user password.

OAuth_token()[source]

Obtain OAuth Token.

authentication()[source]

Gitlab authentication.

get_git_file_info(path: str)[source]

Get file information from the file url, like repository name, user, branch, and file path.

read_file(suf: str)[source]

Get the content of the file.

The address of the file is the prefix of the resource plugin plus the parameter suf.

_abc_impl = <_abc._abc_data object>