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()


# 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()

In the UI

Click on the Blocks menu, then click the + button in the page header to open the block catalog: blocks menu

Then, find the GitLab block and click the Add button: GitLab block catalog entry

Finally, enter your repository information in the form and click Create: GitLab repository information form

Resources

If you encounter any bugs while using prefect-gitlab, feel free to open an issue in the prefect-gitlab repository.

If you have any questions or issues while using prefect-gitlab, you can find help in the Prefect Slack community.

Feel free to ⭐️ or watch prefect-gitlab for updates!

Development

If you'd like to install a version of prefect-gitlab for development, clone the repository and perform an editable install with pip:

git clone https://github.com/prefecthq/prefect-gitlab.git

cd prefect-gitlab/

pip install -e ".[dev]"

# Install linting pre-commit hooks
pre-commit install

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.2.tar.gz (31.1 kB view hashes)

Uploaded Source

Built Distribution

prefect_gitlab-0.2.2-py3-none-any.whl (11.8 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