Created
May 31, 2019 13:51
-
-
Save epcim/b6ba947be23bdf78c50d078378677bd9 to your computer and use it in GitHub Desktop.
gitlab python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python3 | |
import gitlab | |
import sys | |
# private token or personal token authentication | |
gl = gitlab.Gitlab('https://gitlab.com/', private_token='******') | |
if len(sys.argv) > 1: | |
if sys.argv[1].find("/") > 0: | |
project=sys.argv[1] | |
else: | |
project="volterra/ves.io/"+sys.argv[1] | |
gl.auth() | |
project = gl.projects.get(project) | |
print(project.id) | |
else: | |
print("Usage: %s [yourorg/]projectName" % sys.argv[0]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment