Project

lex-gitlab

0.0
No release in over 3 years
Connects LegionIO to GitLab via the REST API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

 Project Readme

lex-gitlab

LegionIO extension for GitLab. Provides runners for interacting with the GitLab REST API covering projects, merge requests, and pipelines.

Installation

Add to your Gemfile:

gem 'lex-gitlab'

Standalone Client Usage

require 'legion/extensions/gitlab'

client = Legion::Extensions::Gitlab::Client.new(
  url: 'https://gitlab.com',
  token: 'your-private-token'
)

# Projects
client.list_projects
client.get_project(project_id: 42)
client.create_project(name: 'my-project', visibility: 'private')

# Merge Requests
client.list_merge_requests(project_id: 42)
client.get_merge_request(project_id: 42, merge_request_iid: 1)
client.create_merge_request(
  project_id: 42,
  title: 'Add new feature',
  source_branch: 'feature/my-feature',
  target_branch: 'main'
)
client.merge_merge_request(project_id: 42, merge_request_iid: 1)

# Pipelines
client.list_pipelines(project_id: 42)
client.get_pipeline(project_id: 42, pipeline_id: 100)
client.create_pipeline(project_id: 42, ref: 'main')
client.retry_pipeline(project_id: 42, pipeline_id: 100)

Self-hosted GitLab

client = Legion::Extensions::Gitlab::Client.new(
  url: 'https://gitlab.example.com',
  token: 'your-private-token'
)

License

MIT