README.md 1.38 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
## Intro

Libsaas extension for gitlab support.

See: https://github.com/ducksboard/libsaas.git

## Installation

~~~bash
sudo apt-get install python-pip
b-sh's avatar
b-sh committed
11
sudo pip install libsaas_gitlab
12 13
~~~

b-sh's avatar
b-sh committed
14
## Run tests
15 16

~~~bash
b-sh's avatar
b-sh committed
17 18
git clone [email protected]:bor-sh-infrastructure/libsaas_gitlab.git
cd libsaas_gitlab
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
python setup.py test
~~~

## Usage

Provide url and token below. And some parts like IDs and so on need to be adjusted.

~~~python
import json
import libsaas_gitlab as gitlab

gitlabServer = "http//gitlab.com"
token        = "8adf3984joiajf"
service      = gitlab.Gitlab(gitlabServer, token)

print json.dumps(service.issues().get({'state':"opened", 'labels':'feature'}), indent=4, sort_keys=True)
print json.dumps(service.project(257579).issue(240301).get(), indent=4, sort_keys=True)
print json.dumps(service.users().get("b-sh"), indent=4, sort_keys=True)

projects = service.projects().get();
print json.dumps(projects, indent=4, sort_keys=True)

for project in projects:
  print "=======mr========"
  mrs = service.project(project['id']).merge_requests().get()
  if mrs:
    for mr in mrs:
      print "Getting comments"
      comments = service.project(project['id']).merge_request(mr['id']).comments().get()
      print "Print comments"
      print json.dumps(comments, indent=4, sort_keys=True)
b-sh's avatar
b-sh committed
50 51 52 53 54
~~~

## Client applications

* git-gitlab: git command line interface to gitlab https://gitlab.com/bor-sh/git-gitlab