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
7c0f11b7
Commit
7c0f11b7
authored
Nov 30, 2022
by
harshavardhan.c
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dev: Automation code issue fixes.
parent
ba823dcc
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
19 deletions
+23
-19
docker_automation/docker_automate_script.py
docker_automation/docker_automate_script.py
+7
-0
docker_automation/docker_register.py
docker_automation/docker_register.py
+5
-7
helm_automation/helm_automate_script.py
helm_automation/helm_automate_script.py
+1
-1
helm_automation/helm_register.py
helm_automation/helm_register.py
+2
-2
scripts/core/docker_handler.py
scripts/core/docker_handler.py
+7
-8
scripts/core/helm_handler.py
scripts/core/helm_handler.py
+1
-1
No files found.
docker_automation/docker_automate_script.py
View file @
7c0f11b7
...
...
@@ -66,3 +66,10 @@ class DockerVersionUpgrade:
tmp_path
=
general_temp_path
,
output_path
=
output_path
,
docker_compose_path
=
docker_compose_path
)
self
.
git_handler_obj
.
push_deployments_to_git
(
repo_link
=
docker_repo
,
private_token
=
EnvironmentVariables
.
git_access_token
,
branch
=
_branch
,
folder_path
=
output_path
,
helm_deployment
=
False
,
base_path
=
docker_compose_path
)
self
.
git_handler_obj
.
create_merge_request
(
repo_link
=
docker_repo
,
source_branch
=
_branch
,
destination_branch
=
_client_name
)
docker_automation/docker_register.py
View file @
7c0f11b7
...
...
@@ -71,12 +71,10 @@ class DockerRegistration:
arguments
=
self
.
arguments
,
compose_info
=
repo_info
,
tmp_path
=
general_temp_path
,
output_path
=
output_path
,
modules
=
_module_names
)
# self.git_handler_obj.push_deployments_to_git(repo_link=docker_repo,
# private_token=EnvironmentVariables.git_access_token,
# branch=_branch,
# folder_path=output_path, helm_deployment=False,
# base_path=docker_compose_path)
# self.git_handler_obj.create_merge_request(repo_link=docker_repo, source_branch=_branch,
# destination_branch=_client_name)
self
.
git_handler_obj
.
push_deployments_to_git
(
repo_link
=
docker_repo
,
private_token
=
EnvironmentVariables
.
git_access_token
,
branch
=
_branch
,
folder_path
=
output_path
,
helm_deployment
=
False
,
base_path
=
docker_compose_path
)
except
Exception
as
e
:
logging
.
exception
(
f
"Exception Occurred while generating the docker compose file {e.args}"
)
helm_automation/helm_automate_script.py
View file @
7c0f11b7
...
...
@@ -69,7 +69,7 @@ class HelmVersionUpgrade:
# global_config_data = common_util.convert_yaml_to_json("ilens-global-configmap.yml")
variables_file
=
"variables.yml"
template_path
=
os
.
path
.
join
(
general_temp_path
,
"
../
templates"
)
template_path
=
os
.
path
.
join
(
general_temp_path
,
"templates"
)
if
not
os
.
path
.
exists
(
template_path
):
os
.
makedirs
(
template_path
)
for
_module
in
_module_names
:
...
...
helm_automation/helm_register.py
View file @
7c0f11b7
...
...
@@ -78,7 +78,7 @@ class HelmRegistration:
if
repo_info
:
global_config_data
.
update
(
repo_info
)
variables_file
=
"variables.yml"
template_path
=
os
.
path
.
join
(
general_temp_path
,
"
../
templates"
)
template_path
=
os
.
path
.
join
(
general_temp_path
,
"templates"
)
if
not
os
.
path
.
exists
(
template_path
):
os
.
makedirs
(
template_path
)
for
_module
in
_module_names
:
...
...
@@ -117,7 +117,7 @@ class HelmRegistration:
new_module
=
deepcopy
(
_module
)
worker_type
=
"worker"
in
_module
or
"celery"
in
_module
if
not
os
.
path
.
exists
(
existing_yml_path
):
existing_yml_path
=
os
.
path
.
join
(
"
../
templates"
,
"helm_deployment.yml"
)
existing_yml_path
=
os
.
path
.
join
(
"templates"
,
"helm_deployment.yml"
)
new_module
=
"helm_deployment"
self
.
helm_handler
.
create_helm_deployment_file
(
template_yml_path
=
existing_yml_path
,
image_tag
=
image_url
,
...
...
scripts/core/docker_handler.py
View file @
7c0f11b7
...
...
@@ -100,13 +100,6 @@ class DockerHandler:
jinja_template_file
=
jinja_template_file
,
template_path
=
template_path
,
outfile_path
=
compose_out_file_path
)
# self.git_handler_obj.push_deployments_to_git(repo_link=docker_repo,
# private_token=EnvironmentVariables.git_access_token,
# branch=source_branch,
# folder_path=output_path, helm_deployment=False,
# base_path=docker_compose_path)
# self.git_handler_obj.create_merge_request(repo_link=docker_repo, source_branch=source_branch,
# destination_branch=destination_branch)
except
Exception
as
e
:
logging
.
exception
(
f
'Exception Occurred while processing the compose data info {e.args}'
)
...
...
@@ -133,7 +126,13 @@ class DockerHandler:
def
get_modules_dict_for_registration
(
modules
,
existing_modules
=
None
):
if
existing_modules
is
None
:
existing_modules
=
[]
return
{
module
:
DockerComposeSchema
()
.
dict
()
for
module
in
modules
if
module
not
in
existing_modules
}
return_dict
=
{}
for
module
in
modules
:
if
module
not
in
existing_modules
:
volumes_list
=
[
f
'/data/mnt/container/logs/{module}:/code/logs'
,
'/data/mnt/container/core-volumes:/code/data'
]
return_dict
[
module
]
=
DockerComposeSchema
(
volumes
=
volumes_list
)
.
dict
()
return
return_dict
@
staticmethod
def
get_defined_module_name
(
module_name
,
module_mapping_dict
):
...
...
scripts/core/helm_handler.py
View file @
7c0f11b7
...
...
@@ -58,7 +58,7 @@ class HelmHandler:
continue
if
global_config_vars
.
get
(
k
):
continue
value_key
=
v
.
strip
(
"
<{ }>
"
)
value_key
=
v
.
strip
(
"
{{ }}
"
)
global_config_vars
.
update
({
k
:
global_config_vars
.
get
(
value_key
,
v
)})
self
.
common_utils
.
render_deployment_chart
(
data_dict
=
{},
jinja_template_file
=
f
'{module_name}.yml'
,
...
...
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