Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save thesamprice/1fe3268ac670f18987ceecb405c4899e to your computer and use it in GitHub Desktop.
Save thesamprice/1fe3268ac670f18987ceecb405c4899e to your computer and use it in GitHub Desktop.
token = token_top
#='/home/user/path/to/cert/certificate_file.crt'
import gitlab
import numpy as np
import regex
import datetime
gl = gitlab.Gitlab('https://personal.gitlab.com/', private_token=token,ssl_verify=False)
gl_epochs = gitlab.Gitlab('https://personal.gitlab.com/', private_token=token_top,ssl_verify=False)
project = gl.projects.get('myproject_group/myproject_name')
labels = project.labels.list(all=True)
git_labels = {}
for l in labels:
git_labels[l.name] = l
def GetGitLabel(label):
if not type(label) is str:
return None
if not label in git_labels:
gitlab_label = {'name':label,
'is_project_label':True,
'color':'#d9534f'}
git_labels[label] = project.labels.create(gitlab_label)
print("made label ", label, git_labels[label])
pass
return git_labels[label]
project_labels = ['Workflow::Assigned','Workflow::In Work','Workflow::Ready To Test','Workflow::In Test']
board_name = "Build 3"
board_json = {
"name": board_name,
}
b = project.boards.create(board_json)
labels = []
for l in project_labels:
l = GetGitLabel(l)
labels.append({'label_id':l.id})
for l in labels:
b.lists.create(l)
#project.boards.create(board_json)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment