Ruby wrapper and CLI for the GitLab REST API
website | documentation | gitlab-live
Gitlab is a Ruby wrapper and CLI for the GitLab API.
Install it from rubygems:
gem install gitlabOr add to a Gemfile:
gem 'gitlab'
# gem 'gitlab', github: 'NARKOZ/gitlab'Mac OS users can install using Homebrew (may not be the latest version):
brew install gitlab-gemConfiguration example:
…(Note: If you are using GitLab.com's hosted service, your endpoint will be https://gitlab.com/api/v4)
Usage examples:
…For more information, refer to documentation.
It is possible to use this gem as a command line interface to GitLab. In order to make that work you need to set a few environment variables:
export GITLAB_API_ENDPOINT=https://gitlab.example.com/api/v4
export GITLAB_API_PRIVATE_TOKEN=
# This one is optional and can be used to set any HTTParty option you may need
# using YAML hash syntax. For example, this is how you would disable SSL
# verification (useful if using a self-signed cert).
export GITLAB_API_HTTPARTY_OPTIONS="{verify: false}"Usage:
When you want to know which CLI commands are supported, take a look at the client commands implemented in this gem. Any of those methods can be called as a command by passing the parameters of the commands as parameters of the CLI.
Usage examples:
…Usage examples:
# start shell session
gitlab shell
# list available commands
gitlab> help
# list groups
gitlab> groups
# protect a branch
gitlab> protect_branch 1 master
# passing options hash to a command (use YAML)
gitlab> create_merge_request 4 "New merge request" "{source_branch: 'new_branch', target_branch: 'master', assignee_id: 42}"Web version is available at https://gitlab-live.herokuapp.com
For more information, refer to website.
docker-compose up -d gitlab # Will start the GitLab instance in the background (approx. 3 minutes)After a while, your GitLab instance will be accessible on http://localhost:3000.
Once you have set your new root password, you can login with the root user.
You can now setup a personal access token here: http://localhost:3000/profile/personal_access_tokens
Once you have your token, set the variables to the correct values in the docker.env file.
Then, launch the tool:
docker-compose run appGitlab.users
=> [#1, "name"=>"Administrator", "username"=>"root", ...]To launch the specs:
docker-compose run app rake specJust change the image from gitlab/gitlab-ce:latest to gitlab/gitlab-ee:latest in the docker-compose.yml file.
First, set the variables to the correct values in the docker.env file.
Then, launch the tool:
docker-compose run appGitlab.users
=> [#1, "name"=>"Administrator", "username"=>"root", ...]To launch the specs,
docker-compose run app rake specAfter checking out the repo, run bin/setup to install dependencies. Then, run
rake spec to run the tests. You can also run bin/console for an interactive
prompt that will allow you to experiment.
For more information see CONTRIBUTING.md.
Released under the BSD 2-clause license. See LICENSE.txt for details.
No open issues yet, or sync has not completed.