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
9960c40c
Commit
9960c40c
authored
Feb 20, 2023
by
harshavardhan.c
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dev: Helm chart code enhancements in order to support automation deployments.
parent
0d06cafd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
helm_automation/helm_automate_script.py
helm_automation/helm_automate_script.py
+3
-0
scripts/core/git_handler.py
scripts/core/git_handler.py
+2
-2
scripts/utils/common_utils.py
scripts/utils/common_utils.py
+11
-0
No files found.
helm_automation/helm_automate_script.py
View file @
9960c40c
...
...
@@ -96,7 +96,10 @@ class HelmVersionUpgrade:
clone_file_path
=
variables_file
):
logging
.
debug
(
"Failed to clone module!! Skipping Helm File Preparation"
)
continue
self
.
common_util
.
add_quotes
(
variables_file_path
)
_module_data
=
self
.
common_util
.
convert_yaml_to_define_obj
(
variables_file_path
)
if
not
_module_data
:
continue
module_env_variables
=
_module_data
.
get
(
'deployment'
,
{})
.
get
(
'environmentVar'
,
[])
module_env_variables
=
{
_v
[
'name'
]:
_v
for
_v
in
module_env_variables
}
template_file
=
os
.
path
.
join
(
template_path
,
f
'{_module}.yml'
)
...
...
scripts/core/git_handler.py
View file @
9960c40c
...
...
@@ -54,8 +54,8 @@ class GitHandler:
try
:
base_url
=
os
.
environ
.
get
(
"GIT_BASE_URL"
,
default
=
default_link
)
gl
=
gitlab
.
Gitlab
(
url
=
base_url
,
private_token
=
self
.
access_token
)
pl
=
gl
.
groups
.
list
(
search
=
"iLens-2.0"
)[
0
]
.
projects
.
list
(
search
=
module_name
,
include_subgroups
=
True
)
pl
=
gl
.
groups
.
list
(
search
=
"iLens-2.0"
,
get_all
=
True
)[
0
]
.
projects
.
list
(
search
=
module_name
,
include_subgroups
=
True
,
get_all
=
True
)
return
pl
[
-
1
]
.
web_url
if
pl
else
''
except
Exception
as
e
:
logging
.
exception
(
f
"Exception occurred while fetching repo details - {e.args}"
)
...
...
scripts/utils/common_utils.py
View file @
9960c40c
...
...
@@ -9,6 +9,17 @@ from scripts.logging import logging
class
CommonUtils
:
@
staticmethod
def
add_quotes
(
file_path
):
my_data
=
""
with
open
(
file_path
,
"r+"
)
as
f
:
data
=
f
.
read
()
data
=
data
.
replace
(
"{{"
,
'
\"
{{'
)
data
=
data
.
replace
(
"}}"
,
'}}
\"
'
)
my_data
=
data
f
.
write
(
data
)
with
open
(
file_path
,
"w+"
)
as
f
:
f
.
write
(
my_data
)
@
staticmethod
def
convert_yaml_to_define_obj
(
yaml_file_path
,
load_type
=
'safe'
):
try
:
if
not
os
.
path
.
exists
(
yaml_file_path
):
...
...
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