Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • gber/website
  • parodper/website
  • sunilmohan/website
  • pabs/blends-website
  • blends-team/website
  • moeller/website
  • jcristau/blends-website
7 results
Show changes
Commits on Source (2)
...@@ -37,7 +37,7 @@ BLENDSGROUPS={ 'Debian 3D Printing Team' : '3dprinter' ...@@ -37,7 +37,7 @@ BLENDSGROUPS={ 'Debian 3D Printing Team' : '3dprinter'
# FIXME: Debian Perl Group is listed with only 2 projects which is definitely wrong # FIXME: Debian Perl Group is listed with only 2 projects which is definitely wrong
# just start with one team # just start with one team
BLENDSGROUPS={ 'Debian Med' : 'debian-med'} # BLENDSGROUPS={ 'Debian Med' : 'debian-med'}
debianmetadata = [ 'changelog', debianmetadata = [ 'changelog',
'control', 'control',
...@@ -54,7 +54,7 @@ READMEDEBIANARCHIVE='/srv/blends.debian.org/www/_'+TDNAME+'/README.Debian.tar.xz ...@@ -54,7 +54,7 @@ READMEDEBIANARCHIVE='/srv/blends.debian.org/www/_'+TDNAME+'/README.Debian.tar.xz
TARGETDIR=os.path.join(os.environ['HOME'],TDNAME) TARGETDIR=os.path.join(os.environ['HOME'],TDNAME)
SLEEPTIME=1 SLEEPTIME=1
SLEEPUNTILRETRY=3600 SLEEPUNTILRETRY=1800
debug=0 debug=0
# do not clean dirs. FIXME: Find a method to detect removed repositories and clean this up here # do not clean dirs. FIXME: Find a method to detect removed repositories and clean this up here
...@@ -63,6 +63,10 @@ try: ...@@ -63,6 +63,10 @@ try:
except: except:
pass pass
def wait_for_salsa():
time.sleep(SLEEPUNTILRETRY)
print("Received GitlabGetError: 429 - Retry later ... waiting for %i seconds" % SLEEPUNTILRETRY )
def get_blends_groups(): def get_blends_groups():
blends_groups=[] blends_groups=[]
groups = gl.groups.list(all=True, order_by='name', sort='asc') groups = gl.groups.list(all=True, order_by='name', sort='asc')
...@@ -87,8 +91,7 @@ def output_metadata(subdir, metadata): ...@@ -87,8 +91,7 @@ def output_metadata(subdir, metadata):
try: try:
file_info = project.repository_blob(item['id']) file_info = project.repository_blob(item['id'])
except gitlab.exceptions.GitlabGetError: except gitlab.exceptions.GitlabGetError:
time.sleep(SLEEPUNTILRETRY) wait_for_salsa()
print("Received GitlabGetError: 429 - Retry later ... waiting for %i seconds" % SLEEPUNTILRETRY )
file_info = project.repository_blob(item['id']) file_info = project.repository_blob(item['id'])
content = base64.b64decode(file_info['content']) content = base64.b64decode(file_info['content'])
if item['name'] == 'metadata': if item['name'] == 'metadata':
...@@ -117,7 +120,11 @@ for group in blends_groups: ...@@ -117,7 +120,11 @@ for group in blends_groups:
# projects = group.projects.list(page=1, per_page=10, order_by='name', sort='asc') # projects = group.projects.list(page=1, per_page=10, order_by='name', sort='asc')
print("%s has %i projects (Blend name %s)" % (group.attributes['name'], len(projects), blend)) # group.attributes['id'], group.attributes['path']) # , group.attributes['description'], group.attributes['full_name']) print("%s has %i projects (Blend name %s)" % (group.attributes['name'], len(projects), blend)) # group.attributes['id'], group.attributes['path']) # , group.attributes['description'], group.attributes['full_name'])
for pr in projects: for pr in projects:
project = gl.projects.get(pr.attributes['id']) # without this extra get repository_tree() fails try:
project = gl.projects.get(pr.attributes['id']) # without this extra get repository_tree() fails
except gitlab.exceptions.GitlabGetError:
wait_for_salsa()
project = gl.projects.get(pr.attributes['id']) # without this extra get repository_tree() fails
name = project.attributes['name'] name = project.attributes['name']
namedir = os.path.join(TARGETDIR, name[0]) namedir = os.path.join(TARGETDIR, name[0])
if not os.path.exists(namedir): if not os.path.exists(namedir):
......