UNCLASSIFIED

Commit 1ea38965 authored by gavin.scallon's avatar gavin.scallon
Browse files

adding in an option for ci_config_path setting for distroless

parent 48889141
......@@ -129,7 +129,7 @@ def fix(url, token, tid, pid):
# fixParameter(url, token, pid, 'default_branch', fixes['default_branch'])
# if fixes['ci_config_path'] != '':
# fixParameter(url, token, pid, 'ci_config_path', fixes['ci_config_path'])
# fixParameter(url, token, pid, 'ci_config_path', 'templates/distroless.yaml@ironbank-tools/ironbank-pipeline')
def fixParameter(url, token, id, key, value):
......
......@@ -51,6 +51,7 @@ def main(argv):
mode = ""
ignoreProjects = []
runModules = []
distrolessProjects = ""
allModules = [
'projects',
......@@ -70,9 +71,10 @@ def main(argv):
usage.append(" --mode [check/fix] Execute in either check mode or fix mode.")
usage.append(" --ignore-projects Comma separated list of project ID's to skip when checking/fixing projects.")
usage.append(" --run-modules Comma separated list of modules to execute. Specify all to execute all modules.")
usage.append(" --distroless-projects Comma separated list of project ID's to skip changing to default pipeline template.")
try:
opts, args = getopt.getopt(argv,"h",["gitlab-url=","gitlab-token=","template-project=","mode=","ignore-projects=","run-modules=","target-group="])
opts, args = getopt.getopt(argv,"h",["gitlab-url=","gitlab-token=","template-project=","mode=","ignore-projects=","run-modules=","distroless-projects=","target-group="])
except getopt.GetoptError:
for i in usage:
print(i)
......@@ -103,6 +105,9 @@ def main(argv):
else:
temp = arg.split(",")
runModules = temp
elif opt in ("--distroless-projects"):
dp = arg.split(",")
distrolessProjects = dp
elif opt in ("--target-group"):
targetGroup = arg
......@@ -147,7 +152,9 @@ def main(argv):
elif mode == 'fix':
if 'projects' in runModules:
projects.fix(gitlab_url, gitlab_token, projectTemplate, i['id'])
if str(i['id']) in distrolessProjects:
projects.fixParameter(url, token, pid, 'ci_config_path', 'templates/distroless.yaml@ironbank-tools/ironbank-pipeline')
if 'file_templates' in runModules:
# file_templates must be first because we unprotect the branch, because of this
# the branches module will always identify the branches as misconfigured.
......
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