Skip to main content

A Prefect collection for working with GitLab repositories.

Project description

prefect-gitlab

PyPI

Welcome!

prefect-gitlab is a Prefect collection for working with GitLab repositories.

Getting Started

Python setup

Requires an installation of Python 3.8 or higher.

We recommend using a Python virtual environment manager such as pipenv, conda, or virtualenv.

This integration is designed to work with Prefect 2.3.0 or higher. For more information about how to use Prefect, please refer to the Prefect documentation.

Installation

Install prefect-gitlab with pip:

pip install prefect-gitlab

Then, register the block types) in this integration to view the storage block type on Prefect Cloud:

prefect block register -m prefect_gitlab

Note, to use the load method on a block, you must already have a block document saved.

Creating a GitLab storage block

In Python

from prefect_gitlab import GitLabRepository

# public GitLab repository
public_gitlab_block = GitLabRepository(
    name="my-gitlab-block",
    repository="https://gitlab.com/testing/my-repository.git"
)

public_gitlab_block.save()


# specific branch or tag of a GitLab repository
branch_gitlab_block = GitLabRepository(
    name="my-gitlab-block",
    reference="branch-or-tag-name",
    repository="https://gitlab.com/testing/my-repository.git"
)

branch_gitlab_block.save()


# Get all history of a specific branch or tag of a GitLab repository
branch_gitlab_block = GitLabRepository(
    name="my-gitlab-block",
    reference="branch-or-tag-name",
    git_depth=None,
    repository="https://gitlab.com/testing/my-repository.git"
)

branch_gitlab_block.save()

# private GitLab repository
private_gitlab_block = GitLabRepository(
    name="my-private-gitlab-block",
    repository="https://gitlab.com/testing/my-repository.git",
    access_token="YOUR_GITLAB_PERSONAL_ACCESS_TOKEN"
)

private_gitlab_block.save()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prefect_gitlab-0.2.4.tar.gz (12.9 kB view hashes)

Uploaded Source

Built Distribution

prefect_gitlab-0.2.4-py3-none-any.whl (11.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page