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
92b6aff4
Commit
92b6aff4
authored
Oct 14, 2022
by
harshavardhan.c
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enh: code fixes.
parent
bb37df04
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
helm_automate_script.py
helm_automate_script.py
+3
-2
scripts/core/git_handler.py
scripts/core/git_handler.py
+3
-0
scripts/core/helm_handler.py
scripts/core/helm_handler.py
+2
-2
No files found.
helm_automate_script.py
View file @
92b6aff4
...
@@ -163,6 +163,7 @@ if __name__ == '__main__':
...
@@ -163,6 +163,7 @@ if __name__ == '__main__':
os
.
makedirs
(
module_path
)
os
.
makedirs
(
module_path
)
helm_out_file_path
=
os
.
path
.
join
(
OUTPUT_PATH
,
f
'{_module}.yml'
)
helm_out_file_path
=
os
.
path
.
join
(
OUTPUT_PATH
,
f
'{_module}.yml'
)
if
os
.
path
.
exists
(
helm_out_file_path
):
if
os
.
path
.
exists
(
helm_out_file_path
):
logging
.
debug
(
f
"Helm Deployment File found for selected the module {_module}"
)
continue
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
)
...
@@ -203,8 +204,8 @@ if __name__ == '__main__':
...
@@ -203,8 +204,8 @@ if __name__ == '__main__':
helm_out_file_path
=
helm_out_file_path
,
helm_out_file_path
=
helm_out_file_path
,
global_config_data
=
global_config_data
,
global_config_data
=
global_config_data
,
module_name
=
_file
.
split
(
".yml"
)[
0
])
module_name
=
_file
.
split
(
".yml"
)[
0
])
push_helm_deployments
(
helm_repo
,
git_access_token
,
_client_name
,
final_helm_path
=
OUTPUT_PATH
,
#
push_helm_deployments(helm_repo, git_access_token, _client_name, final_helm_path=OUTPUT_PATH,
base_path
=
helm_path
)
#
base_path=helm_path)
except
Exception
as
e
:
except
Exception
as
e
:
logging
.
exception
(
f
"Exception Occurred while processing the Helm-Script Preparation {e.args}"
)
logging
.
exception
(
f
"Exception Occurred while processing the Helm-Script Preparation {e.args}"
)
...
...
scripts/core/git_handler.py
View file @
92b6aff4
...
@@ -43,6 +43,9 @@ class GitHandler:
...
@@ -43,6 +43,9 @@ class GitHandler:
with
open
(
file_output_path
,
'wb'
)
as
f
:
with
open
(
file_output_path
,
'wb'
)
as
f
:
pl
.
files
.
raw
(
file_path
=
clone_file_path
,
ref
=
clone_branch
,
streamed
=
True
,
action
=
f
.
write
)
pl
.
files
.
raw
(
file_path
=
clone_file_path
,
ref
=
clone_branch
,
streamed
=
True
,
action
=
f
.
write
)
return
True
return
True
except
gitlab
.
exceptions
.
GitlabGetError
as
e
:
logging
.
debug
(
f
"Variables.yml not found for selected the module {repo_link}"
)
return
False
except
Exception
as
e
:
except
Exception
as
e
:
logging
.
exception
(
f
"Exception occurred while cloning the git repo - {repo_link} - {e.args}"
)
logging
.
exception
(
f
"Exception occurred while cloning the git repo - {repo_link} - {e.args}"
)
return
False
return
False
...
...
scripts/core/helm_handler.py
View file @
92b6aff4
...
@@ -24,8 +24,8 @@ class HelmHandler:
...
@@ -24,8 +24,8 @@ class HelmHandler:
existing_data
.
get
(
'deployment'
,
{})
.
get
(
'environmentVar'
,
[])}
existing_data
.
get
(
'deployment'
,
{})
.
get
(
'environmentVar'
,
[])}
diff_keys
=
list
(
set
(
existing_env_variables
.
keys
())
.
symmetric_difference
(
set
(
module_env_variables
.
keys
())))
diff_keys
=
list
(
set
(
existing_env_variables
.
keys
())
.
symmetric_difference
(
set
(
module_env_variables
.
keys
())))
for
_each
in
diff_keys
:
for
_each
in
diff_keys
:
if
_each
.
lower
()
in
{
'port'
,
'service_port'
,
'module_port'
}
and
module_env_variables
[
_each
]
.
get
(
if
_each
.
lower
()
in
{
'port'
,
'service_port'
,
'module_port'
}
and
module_env_variables
.
get
(
_each
)
and
\
"value"
):
module_env_variables
[
_each
]
.
get
(
"value"
):
global_config_vars
[
"SERVICE_PORT"
]
=
module_env_variables
[
_each
][
"value"
]
global_config_vars
[
"SERVICE_PORT"
]
=
module_env_variables
[
_each
][
"value"
]
continue
continue
if
module_env_variables
.
get
(
_each
):
if
module_env_variables
.
get
(
_each
):
...
...
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