Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dimitri Podborski
AutomationTools
Commits
d352b515
Commit
d352b515
authored
Jan 08, 2021
by
Dimitri Podborski
Browse files
remove garbage
parent
ee3a80d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
testAPI.py
deleted
100755 → 0
View file @
ee3a80d7
""" Test GitLab API
To work properly this script requires following:
1. GITLAB_TOKEN environment variable to be set to your private token.
Create your private token here: http://mpegx.int-evry.fr/software/profile/personal_access_tokens
2. pip install --upgrade python-gitlab
"""
import
os
import
sys
import
gitlab
TOKEN
=
os
.
environ
.
get
(
'GITLAB_TOKEN'
)
PROJECT_ID
=
272
if
not
TOKEN
:
print
(
"No private token found, please set the GITLAB_TOKEN environment variable"
)
sys
.
exit
(
1
)
# private token authentication
gl
=
gitlab
.
Gitlab
(
'http://mpegx.int-evry.fr/software'
,
private_token
=
TOKEN
)
# get all projects
# projects = gl.projects.list(all=True)
# print(len(projects))
project
=
gl
.
projects
.
get
(
PROJECT_ID
)
print
(
project
)
# list issues
issues
=
project
.
issues
.
list
()
print
(
"List all issues of the project"
)
for
issue
in
issues
:
print
(
''
)
print
(
issue
)
print
(
issue
.
labels
)
print
(
'_____________'
)
# get issue
# issue = project.issues.get(iid)
# create new issue
# issue = project.issues.create({'title': 'Created using API', 'description': 'Foobar some text here'})
# update an issue
# issue.labels = ['Bug', 'Info']
# issue.save()
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment