gitlab-haskell: A Haskell library for the GitLab web API

[ bsd3, git, library ] [ Propose Tags ]

This Haskell library queries and updates the database of a GitLab instance using the GitLab web API: https://docs.gitlab.com/ee/api/

Unsurprisingly, GitLab hosts this Haskell library: https://gitlab.com/robstewart57/gitlab-haskell


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.1.6, 0.1.7, 0.1.8, 0.2, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.2.5, 0.3.0, 0.3.0.1, 0.3.0.2, 0.3.1, 0.3.1.1, 0.3.2.0, 1.0.0.0, 1.0.0.1, 1.0.0.3, 1.0.0.4, 1.0.0.5
Dependencies aeson, base (>=4.7 && <5), bytestring, connection, gitlab-haskell, http-conduit (>=2.3.4), http-types, optparse-applicative, text, transformers, unliftio, unliftio-core [details]
License BSD-3-Clause
Copyright 2019 Rob Stewart, Heriot-Watt University
Author Rob Stewart
Maintainer robstewart57@gmail.com
Category Git
Home page https://gitlab.com/robstewart57/gitlab-haskell
Bug tracker https://gitlab.com/robstewart57/gitlab-haskell/issues
Source repo head: git clone https://gitlab.com/robstewart57/gitlab-haskell
Uploaded by RobStewart at 2019-10-06T16:22:27Z
Distributions Stackage:1.0.0.5
Executables gitlab-tools
Downloads 7107 total (90 in the last 30 days)
Rating 2.25 (votes: 2) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2019-10-06 [all 1 reports]

Readme for gitlab-haskell-0.1.2

[back to package description]

A Haskell library for the GitLab web API

gitlab-haskell library

This library interacts with a GitLab server's API. It supports queries about and updates to:

  • Branches
  • Commits
  • Groups
  • Issues
  • Jobs
  • Members
  • Merge requests
  • Pipelines
  • Projects
  • Repositories
  • Repository files
  • Users

The library parses JSON results into Haskell data types in the GitLab.Types module.

gitlab-tools executable

This package also includes a gitlab-tools executable.

> gitlab-tools --help
Program to execute bulk GitLab actions

Usage: gitlab-tools --host host [--token token] [--filename filename]
                    [--group group] [--project project]
                    [--add-reporters-to-group] [--share-projects-with-group]
                    [--registered]
  Executes actions against a GitLab server

Available options:
  --host host              URL of the GitLab server
  --token token            GitLab access token
  --filename filename      name of a CSV file
  --group group            name of a group
  --project project        name of a project
  --add-reporters-to-group Add users as reporters to a group
  --share-projects-with-group
                           Share all projects with a given name to the specific
                           group
  --registered             prints 'yes' or 'no' depending on whether a user
                           exists on the GitLab server
  -h,--help                Show this help text

Examples

Sharing projects with a group:

> gitlab-tools \
    --host <GitLab url> --token <token> \
    --share-projects-with-group --project my_project \
    --group my_group

This commands finds all projects called my_project then adds the my_group group to all of those projects as a member with the Reporter role.

Adding users to a group:

> gitlab-tools \
    --host <GitLab url> --token <token> \
    --filename <filename>.csv \
    --add-reporters-to-group \
    --group my_group

This command reads usernames from a comma separated file, and if they are registered on the GitLab server it adds them to the my_group group with the Reporter role.