UNCLASSIFIED

Commit 562edddb authored by Joshua Eason's avatar Joshua Eason
Browse files

Removing badge support

parent c85056c9
......@@ -4,13 +4,7 @@ import json
import urllib.parse
import re
link_ibfe = "https://ironbank.dsop.io/ironbank/repomap/"
link_registry1 = "https://registry1.dsop.io/harbor/projects/3/repositories/"
link_pipeline = "https://repo1.dsop.io/"
image_ibfe = "https://img.shields.io/badge/Website-Iron%20Bank-informational"
image_registry1 = "https://img.shields.io/badge/Website-Registry1-informational"
image_pipeline = "https://repo1.dsop.io/"
##### Supporting methods
......@@ -74,14 +68,7 @@ def __createBadge(url, token, id, badge, project):
'image_url': ''
}
if badge['name'] == 'ibfe':
PARAMS['link_url'] = link_ibfe + project
PARAMS['link_url'] = re.search("(.*)/", PARAMS['link_url']).group(1)
PARAMS['image_url'] = image_ibfe
elif badge['name'] == 'registry1':
PARAMS['link_url'] = link_registry1 + project.replace("/", "%2F")
PARAMS['image_url'] = image_registry1
elif badge['name'] == 'pipeline':
if badge['name'] == 'pipeline':
PARAMS['link_url'] = link_pipeline + "dsop/" + project + "/-/pipelines"
PARAMS['image_url'] = image_pipeline + "dsop/" + project + "/badges/master/pipeline.svg"
else:
......@@ -104,14 +91,7 @@ def __fixBadge(url, token, id, badge, project):
'image_url': ''
}
if badge['name'] == 'ibfe':
PARAMS['link_url'] = link_ibfe + project
PARAMS['link_url'] = re.search("(.*)/", PARAMS['link_url']).group(1)
PARAMS['image_url'] = image_ibfe
elif badge['name'] == 'registry1':
PARAMS['link_url'] = link_registry1 + project.replace("/", "%2F")
PARAMS['image_url'] = image_registry1
elif badge['name'] == 'pipeline':
if badge['name'] == 'pipeline':
PARAMS['link_url'] = link_pipeline + "dsop/" + project + "/-/pipelines"
PARAMS['image_url'] = image_pipeline + "dsop/" + project + "/badges/master/pipeline.svg"
else:
......@@ -160,9 +140,6 @@ def checkMissing(tbadges, pbadges):
return notFound
def checkMisconfigured(tbadges, pbadges, project):
ibfe_link_url = link_ibfe + project
ibfe_link_url = re.search("(.*)/", ibfe_link_url).group(1)
registry1_link_url = link_registry1 + project.replace("/", "%2F")
pipeline_link_url = link_pipeline + "dsop/" + project + "/-/pipelines"
pipeline_image_url = image_pipeline + "dsop/" + project + "/badges/master/pipeline.svg"
......@@ -173,13 +150,7 @@ def checkMisconfigured(tbadges, pbadges, project):
if a['kind'] == 'project':
for b in pbadges:
if a['name'] == b['name'] and b['kind'] == 'project':
if b['name'] == "ibfe":
if b['link_url'] != ibfe_link_url or b['image_url'] != image_ibfe:
miss = True
elif b['name'] == "registry1":
if b['link_url'] != registry1_link_url or b['image_url'] != image_registry1:
miss = True
elif b['name'] == "pipeline":
if b['name'] == "pipeline":
if b['link_url'] != pipeline_link_url or b['image_url'] != pipeline_image_url:
miss = True
else:
......
......@@ -144,11 +144,11 @@ def main(argv):
if 'branches' in runModules:
branches.check(gitlab_url, gitlab_token, projectTemplate, i['id'])
if 'badges' in runModules:
badges.check(gitlab_url, gitlab_token, projectTemplate, i['id'])
# if 'badges' in runModules:
# badges.check(gitlab_url, gitlab_token, projectTemplate, i['id'])
if 'approval_badges' in runModules:
approval_badges.check(gitlab_url, gitlab_token, i['id'])
# # if 'approval_badges' in runModules:
# # approval_badges.check(gitlab_url, gitlab_token, i['id'])
elif mode == 'fix':
if 'projects' in runModules:
projects.fix(gitlab_url, gitlab_token, projectTemplate, i['id'])
......@@ -163,11 +163,11 @@ def main(argv):
if 'branches' in runModules:
branches.fix(gitlab_url, gitlab_token, projectTemplate, i['id'])
if 'badges' in runModules:
badges.fix(gitlab_url, gitlab_token, projectTemplate, i['id'])
# if 'badges' in runModules:
# badges.fix(gitlab_url, gitlab_token, projectTemplate, i['id'])
if 'approval_badges' in runModules:
approval_badges.fix(gitlab_url, gitlab_token, i['id'])
# if 'approval_badges' in runModules:
# approval_badges.fix(gitlab_url, gitlab_token, i['id'])
else:
logging.critical("Unsupported mode of operation!")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment