Giter VIP home page Giter VIP logo

gitlab-to-sqlite's Introduction

gitlab-to-sqlite

PyPI License

Save data from GitLab to a SQLite database.

Attribution

The overall structure and CLI is taken from https://github.com/dogsheep/github-to-sqlite/.

How to install

$ pip install gitlab-to-sqlite

Authentication

Create a GitLab personal access token: https://gitlab.com/-/profile/personal_access_tokens

Run this command and paste in your new token:

$ gitlab-to-sqlite auth

This will create a file called auth.json in your current directory containing the required value. To save the file at a different path or filename, use the --auth=myauth.json option.

As an alternative to using an auth.json file you can add your access token to an environment variable called GITLAB_TOKEN.

Using custom gitlab instance

When running auth you may specify an optional --host parameter pointing to a custom instance.

$ gitlab-to-sqlite auth --host gitlab.internal

Fetching projects

The projects command retrieves a single project.

$ gitlab-to-sqlite projects gitlab.db group/project-name

Fetching merge requests

The merge-requests command retrieves updated or created merge requests.

$ gitlab-to-sqlite merge-requests gitlab.db group/project-name

This command can be run regularly. Based on the most recent created or updated merge request it only fetches changes that happened afterwards.

Fetching pipelines

The pipelines command retrieves updated or created pipelines with their corresponding jobs.

$ gitlab-to-sqlite pipelines gitlab.db group/project-name

This command can be run regularly. Based on the most recent created or updated pipeline it only fetches changes that happened afterwards.

Fetching environments

The environments command retrieves all environments of a single project.

$ gitlab-to-sqlite projects gitlab.db group/project-name

Fetching deployments

The deployments command retrieves all deployments of a specific environment in a single project.

$ gitlab-to-sqlite deployments gitlab.db group/project-name environment-name

This command can be run regularly. Based on the most recent created or updated deployment it only fetches changes that happened afterwards.

Fetching commits

The commits command retrieves all commits of a single project.

$ gitlab-to-sqlite commits gitlab.db group/project-name

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.