Fixup: Deadline for all projects
This commit is contained in:
parent
438e51b2bf
commit
9fe547813f
1 changed files with 12 additions and 6 deletions
|
@ -24,13 +24,18 @@ class Deadline(yaml.YAMLObject):
|
||||||
"""Create protected tag on ref"""
|
"""Create protected tag on ref"""
|
||||||
|
|
||||||
log.info('Creating tag %s' % self.tag)
|
log.info('Creating tag %s' % self.tag)
|
||||||
|
tags = project.tags.list(search=self.tag)
|
||||||
|
if len(tags) > 0:
|
||||||
|
print(tags)
|
||||||
|
return
|
||||||
|
|
||||||
project.tags.create({
|
project.tags.create({
|
||||||
'tag_name': self.tag,
|
'tag_name': self.tag,
|
||||||
'ref': self.ref
|
'ref': self.ref
|
||||||
})
|
})
|
||||||
|
|
||||||
def test(self):
|
def test(self):
|
||||||
return self.time <= datetime.datetime.now()
|
return self.time <= datetime.date.today()
|
||||||
|
|
||||||
|
|
||||||
class Course(yaml.YAMLObject):
|
class Course(yaml.YAMLObject):
|
||||||
|
@ -211,11 +216,12 @@ def deadlines(gl, conf, args):
|
||||||
for course in conf['courses']:
|
for course in conf['courses']:
|
||||||
for deadline in course.deadlines:
|
for deadline in course.deadlines:
|
||||||
if deadline.test():
|
if deadline.test():
|
||||||
for project in course.group.projects.list():
|
group = gl.groups.list(search=course.name)[0]
|
||||||
try:
|
course.group = gl.groups.get(group.id)
|
||||||
|
for project in course.group.projects.list(all=True):
|
||||||
|
project = gl.projects.get(project.id)
|
||||||
|
print(project.name)
|
||||||
deadline.trigger(project)
|
deadline.trigger(project)
|
||||||
except gitlab.exceptions.GitlabHttpError as e:
|
|
||||||
log.warn(e)
|
|
||||||
|
|
||||||
|
|
||||||
def sync(gl, conf, args):
|
def sync(gl, conf, args):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue