lab

command module
v0.17.3-0...-2a221cc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2020 License: CC0-1.0 Imports: 12 Imported by: 0

README

FORK

This is a maintained fork of lab with a few new features:

  • Creating a project in a specific group (or in a namespace)
  • Renaming a project
  • Unprotecting branches (to allow force push)
  • Protecting branches
  • Import CI variables
  • Export CI variables
  • Enable/Disable specific runners for projects

If you're not interested in this very particular features, you should stay with zaquestion/lab.

git + = gitlab Build Status Go Report Card codecov CC0 License Donate

Lab wraps Git or Hub, making it simple to clone, fork, and interact with repositories on GitLab, including seamless workflows for creating merge requests, issues and snippets.

$ lab clone gitlab-com/infrastructure

# expands to:
$ git clone [email protected]:gitlab-com/infrastructure

hub + = hublab??

lab will look for hub and uses that as your git binary when available so you don't have to give up hub to use lab

$ lab version
git version 2.11.0
hub version 2.3.0-pre9
lab version 0.17.2

Inspiration

The hub tool made my life significantly easier and still does! lab is heavily inspired by hub and attempts to provide a similar feel.

Installation

Dependencies

  • git or hub
Homebrew
brew install zaquestion/tap/lab
Scoop
scoop bucket add zaquestion https://github.com/zaquestion/scoop-bucket.git
scoop install lab
Alpine
apk add lab
Bash

Installs lab into /usr/local/bin/

curl -s https://raw.githubusercontent.com/kovetskiy/lab/master/install.sh | sudo bash

NOTE: Please take care when executing scripts in this fashion. Make sure you trust the developer providing the script and consider peaking at the install script itself (ours is pretty simply ;)

PreBuilt Binaries

Head to the releases page and download your preferred release

Source

Required

git clone [email protected]:kovetskiy/lab
cd lab
go install -ldflags "-X \"main.version=$(git  rev-parse --short=10 HEAD)\"" .

or

make install
Tests

See the contribution guide.

Configuration

lab needs your GitLab information in order to interact with to your GitLab instance. There are several ways to provide this information to lab:

  1. environment variables: LAB_CORE_HOST, LAB_CORE_TOKEN;
  2. environment variables: CI_PROJECT_URL, CI_JOB_TOKEN;
    • Note: these are meant for when lab is running within a GitLab CI pipeline
  3. directory-specific configuration file in HashiCorp configuration language (HCL): ./lab.hcl;
  4. user-specific configuration file in HCL: ~/.config/lab.hcl.

These are checked in order. If no suitable config values are found, lab will prompt for your GitLab information and save it into ~/.config/lab.hcl. For example:

$ lab
Enter default GitLab host (default: https://gitlab.com):
Enter default GitLab token:

Completions

lab provides completions for bash and zsh.

Bash

lab completion bash will generate a bash completion script. Save this script and source it in your .bashrc:

source "/path/to/lab-completions.bash"
Zsh

lab completion zsh will generate a zsh completion script. zsh completions are denoted with the syntax _command-name, so save the output of lab completion to a file name _lab. Place the file in your $FPATH, or create an new directory and add it to your $FPATH.

fpath=(/path/to/script_directory $fpath)

Aliasing

Like hub, lab feels best when aliased as git. In your .bashrc or .bash_profile

alias git=lab

CC0
To the extent possible under law, Zaq? Wiedmann has waived all copyright and related or neighboring rights to Lab. This work is published from: United States.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
copy
Package copy provides a function to recursively copy filesystem directories.
Package copy provides a function to recursively copy filesystem directories.
git
lab
Package lab is an internal wrapper for the go-gitlab package Most functions serve to expose debug logging if set and accept a project name string over an ID.
Package lab is an internal wrapper for the go-gitlab package Most functions serve to expose debug logging if set and accept a project name string over an ID.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL