Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
Helm-Automation-Script
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
harshavardhan.c
Helm-Automation-Script
Commits
144753c7
Commit
144753c7
authored
Sep 29, 2022
by
sangeetha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated arguments changes
parent
a4a5501c
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
673 deletions
+12
-673
helm_automate_script.py
helm_automate_script.py
+12
-21
logs/helm-automation-script.log
logs/helm-automation-script.log
+0
-652
No files found.
helm_automate_script.py
View file @
144753c7
...
@@ -8,6 +8,7 @@ import logging
...
@@ -8,6 +8,7 @@ import logging
import
os
import
os
import
shutil
import
shutil
import
sys
import
sys
from
typing
import
List
import
git
import
git
import
gitlab
import
gitlab
...
@@ -148,20 +149,12 @@ if __name__ == '__main__':
...
@@ -148,20 +149,12 @@ if __name__ == '__main__':
help
=
"Client Name Tag"
help
=
"Client Name Tag"
)
)
ap
.
add_argument
(
ap
.
add_argument
(
"--
git_repo
s"
,
"--
module_detail
s"
,
"-
gr
"
,
"-
md
"
,
required
=
False
,
required
=
False
,
default
=
None
,
default
=
None
,
help
=
"Git repos to be added in helm"
,
type
=
json
.
loads
,
nargs
=
"+"
help
=
"Module details to be added in helm"
,
)
ap
.
add_argument
(
"--module_names"
,
"-mn"
,
required
=
False
,
default
=
None
,
help
=
"Module names to be added in helm"
,
nargs
=
"+"
)
)
ap
.
add_argument
(
ap
.
add_argument
(
"--exclude_files"
,
"--exclude_files"
,
...
@@ -175,11 +168,10 @@ if __name__ == '__main__':
...
@@ -175,11 +168,10 @@ if __name__ == '__main__':
_ilens_version
=
arguments
[
"ilens_version"
]
_ilens_version
=
arguments
[
"ilens_version"
]
_release_version
=
arguments
[
"release_version"
]
_release_version
=
arguments
[
"release_version"
]
_client_name
=
arguments
[
'client_name'
]
_client_name
=
arguments
[
'client_name'
]
_git_repos
=
arguments
[
"git_repos"
]
_module_details
=
arguments
[
'module_details'
]
_module_names
=
arguments
[
"module_names"
]
_exclude_files
=
arguments
[
"exclude_files"
]
_exclude_files
=
arguments
[
"exclude_files"
]
if
not
_ilens_version
or
not
_release_version
or
not
_client_name
or
not
(
_git_repos
or
_module_names
)
or
not
global_configmap
:
if
not
_ilens_version
or
not
_release_version
or
not
_client_name
or
not
_module_details
or
not
global_configmap
:
print
(
"global_configmap,
git_repos, module_name
s, client_name, ilens_version and release_version details not found!!!!!"
)
print
(
"global_configmap,
module_detail
s, client_name, ilens_version and release_version details not found!!!!!"
)
sys
.
exit
()
sys
.
exit
()
_branch
=
f
"{_client_name}_{_ilens_version}.{_release_version}"
_branch
=
f
"{_client_name}_{_ilens_version}.{_release_version}"
try
:
try
:
...
@@ -188,10 +180,9 @@ if __name__ == '__main__':
...
@@ -188,10 +180,9 @@ if __name__ == '__main__':
sys
.
exit
()
sys
.
exit
()
with
open
(
"config.json"
,
"r"
)
as
f
:
with
open
(
"config.json"
,
"r"
)
as
f
:
data
=
json
.
load
(
f
)
data
=
json
.
load
(
f
)
if
_git_repos
:
_git_repos
=
[
x
[
'git_link'
]
for
x
in
_module_details
if
x
.
get
(
'git_link'
)]
data
[
'git_modules'
]
=
[
x
for
x
in
data
[
'git_modules'
]
if
x
[
'git_link'
]
in
_git_repos
]
_module_names
=
[
x
[
'module_name'
]
for
x
in
_module_details
if
x
.
get
(
'module_name'
)]
else
:
data
[
'git_modules'
]
=
[
x
for
x
in
data
[
'git_modules'
]
if
(
x
[
'module_name'
]
in
_module_names
)
or
(
x
[
'git_link'
]
in
_git_repos
)]
data
[
'git_modules'
]
=
[
x
for
x
in
data
[
'git_modules'
]
if
x
[
'module_name'
]
in
_module_names
]
global_config_data
=
convert_yaml_to_json
(
global_configmap
)
global_config_data
=
convert_yaml_to_json
(
global_configmap
)
remove_all_files_from_repo
(
exclude_file
=
_exclude_files
)
remove_all_files_from_repo
(
exclude_file
=
_exclude_files
)
for
_data
in
data
.
get
(
'git_modules'
):
for
_data
in
data
.
get
(
'git_modules'
):
...
@@ -203,7 +194,7 @@ if __name__ == '__main__':
...
@@ -203,7 +194,7 @@ if __name__ == '__main__':
module_path
=
os
.
path
.
join
(
"tmp"
)
module_path
=
os
.
path
.
join
(
"tmp"
)
module_name
=
_data
[
'module_name'
]
module_name
=
_data
.
get
(
'module_name'
)
or
git_link
.
split
(
"/"
)[
-
1
]
.
split
(
".git"
)
module_path
=
os
.
path
.
join
(
module_path
,
module_name
)
module_path
=
os
.
path
.
join
(
module_path
,
module_name
)
if
not
os
.
path
.
exists
(
module_path
):
if
not
os
.
path
.
exists
(
module_path
):
os
.
makedirs
(
module_path
)
os
.
makedirs
(
module_path
)
...
...
logs/helm-automation-script.log
View file @
144753c7
This diff is collapsed.
Click to expand it.
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