UNCLASSIFIED
Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Ironbank Tools
project-template
Commits
1ea38965
Commit
1ea38965
authored
Jan 15, 2021
by
gavin.scallon
Browse files
adding in an option for ci_config_path setting for distroless
parent
48889141
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
modules/projects.py
modules/projects.py
+1
-1
template.py
template.py
+9
-2
No files found.
modules/projects.py
View file @
1ea38965
...
...
@@ -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
):
...
...
template.py
View file @
1ea38965
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment