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
bb37df04
Commit
bb37df04
authored
Oct 14, 2022
by
harshavardhan.c
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enh: support for modules preparation when user.
parent
83c7a4bf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
helm_automate_script.py
helm_automate_script.py
+12
-4
No files found.
helm_automate_script.py
View file @
bb37df04
...
@@ -23,7 +23,7 @@ git_user_name = os.environ.get("GIT_USERNAME", default="harshavardhan.c")
...
@@ -23,7 +23,7 @@ git_user_name = os.environ.get("GIT_USERNAME", default="harshavardhan.c")
git_access_token
=
os
.
environ
.
get
(
"GIT_TOKEN"
,
default
=
"FEMA6PnP63fJCs6DrtZJ"
)
git_access_token
=
os
.
environ
.
get
(
"GIT_TOKEN"
,
default
=
"FEMA6PnP63fJCs6DrtZJ"
)
config_variables
=
os
.
environ
.
get
(
"CONFIG_MAP_VARIABLES"
,
default
=
""
)
.
split
(
","
)
config_variables
=
os
.
environ
.
get
(
"CONFIG_MAP_VARIABLES"
,
default
=
""
)
.
split
(
","
)
helm_repo
=
os
.
environ
.
get
(
"HELM_REPO"
,
default
=
""
)
helm_repo
=
os
.
environ
.
get
(
"HELM_REPO"
,
default
=
""
)
global_configmap
=
os
.
environ
.
get
(
"GLOBAL_VARIABLES_FILE"
,
default
=
"ilens-
global-configmap
.yml"
)
global_configmap
=
os
.
environ
.
get
(
"GLOBAL_VARIABLES_FILE"
,
default
=
"ilens-
env-spec-variables
.yml"
)
HELM_PATH
=
"/ilens-core/ilens-modules"
HELM_PATH
=
"/ilens-core/ilens-modules"
HELM_STORE_PATH
=
"./helm-charts"
HELM_STORE_PATH
=
"./helm-charts"
...
@@ -143,8 +143,14 @@ if __name__ == '__main__':
...
@@ -143,8 +143,14 @@ if __name__ == '__main__':
logging
.
error
(
f
"Cannot clone helm repo with branch: {_branch}"
)
logging
.
error
(
f
"Cannot clone helm repo with branch: {_branch}"
)
sys
.
exit
()
sys
.
exit
()
base_helm_directory_path
=
os
.
path
.
join
(
HELM_TEMP_PATH
,
"helm-charts"
,
"ilens-core"
,
"ilens-modules"
)
base_helm_directory_path
=
os
.
path
.
join
(
HELM_TEMP_PATH
,
"helm-charts"
,
"ilens-core"
,
"ilens-modules"
)
# global_config_data = convert_yaml_to_json(os.path.join(base_helm_directory_path, global_configmap))
if
len
(
_module_names
)
==
1
and
_module_names
[
0
]
.
lower
()
==
"all"
:
global_config_data
=
common_util
.
convert_yaml_to_json
(
"ilens-global-configmap.yml"
)
updated_list
=
[]
files_info
=
os
.
listdir
(
base_helm_directory_path
)
sorted_files
=
list
(
filter
(
lambda
f
:
f
.
endswith
(
".yml"
),
files_info
))
_module_names
=
[
_each
.
replace
(
".yml"
,
""
)
for
_each
in
sorted_files
]
global_config_data
=
common_util
.
convert_yaml_to_json
(
os
.
path
.
join
(
base_helm_directory_path
,
global_configmap
))
# global_config_data = common_util.convert_yaml_to_json("ilens-global-configmap.yml")
variables_file
=
"variables.yml"
variables_file
=
"variables.yml"
template_path
=
os
.
path
.
join
(
GENERAL_TEMP_PATH
,
"templates"
)
template_path
=
os
.
path
.
join
(
GENERAL_TEMP_PATH
,
"templates"
)
...
@@ -155,6 +161,9 @@ if __name__ == '__main__':
...
@@ -155,6 +161,9 @@ if __name__ == '__main__':
module_path
=
os
.
path
.
join
(
module_path
,
_module
)
module_path
=
os
.
path
.
join
(
module_path
,
_module
)
if
not
os
.
path
.
exists
(
module_path
):
if
not
os
.
path
.
exists
(
module_path
):
os
.
makedirs
(
module_path
)
os
.
makedirs
(
module_path
)
helm_out_file_path
=
os
.
path
.
join
(
OUTPUT_PATH
,
f
'{_module}.yml'
)
if
os
.
path
.
exists
(
helm_out_file_path
):
continue
variables_file_path
=
os
.
path
.
join
(
module_path
,
variables_file
)
variables_file_path
=
os
.
path
.
join
(
module_path
,
variables_file
)
git_info
=
git_handler_obj
.
get_git_url_by_module_name
(
module_name
=
_module
)
git_info
=
git_handler_obj
.
get_git_url_by_module_name
(
module_name
=
_module
)
if
not
git_info
:
if
not
git_info
:
...
@@ -169,7 +178,6 @@ if __name__ == '__main__':
...
@@ -169,7 +178,6 @@ if __name__ == '__main__':
module_env_variables
=
_module_data
.
get
(
'deployment'
,
{})
.
get
(
'environmentVar'
,
[])
module_env_variables
=
_module_data
.
get
(
'deployment'
,
{})
.
get
(
'environmentVar'
,
[])
module_env_variables
=
{
_v
[
'name'
]:
_v
for
_v
in
module_env_variables
}
module_env_variables
=
{
_v
[
'name'
]:
_v
for
_v
in
module_env_variables
}
template_file
=
os
.
path
.
join
(
template_path
,
f
'{_module}.yml'
)
template_file
=
os
.
path
.
join
(
template_path
,
f
'{_module}.yml'
)
helm_out_file_path
=
os
.
path
.
join
(
OUTPUT_PATH
,
f
'{_module}.yml'
)
session_obj
=
get_db_for_func
()
session_obj
=
get_db_for_func
()
module_info
=
db_handler
.
get_module_versions
(
module_info
=
db_handler
.
get_module_versions
(
input_data
=
GetRequest
(
module_name
=
_module
,
client
=
'iLens'
,
ilens_version
=
_ilens_version
,
input_data
=
GetRequest
(
module_name
=
_module
,
client
=
'iLens'
,
ilens_version
=
_ilens_version
,
...
...
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