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
62834a9d
Commit
62834a9d
authored
Oct 12, 2022
by
harshavardhan.c
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enh: functionality changes while preparing the helm chart.
parent
6ba91763
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
17 deletions
+15
-17
main.py
main.py
+6
-6
scripts/core/helm_handler.py
scripts/core/helm_handler.py
+6
-8
scripts/db/psql/models/__init__.py
scripts/db/psql/models/__init__.py
+3
-3
No files found.
main.py
View file @
62834a9d
...
@@ -27,9 +27,9 @@ app.add_middleware(
...
@@ -27,9 +27,9 @@ app.add_middleware(
)
)
@
app
.
on_event
(
"startup"
)
#
@app.on_event("startup")
async
def
startup_event
():
#
async def startup_event():
"""
#
"""
This function is to create default database and tables,
#
This function is to create default database and tables,
"""
#
"""
create_default_psql_dependencies
()
#
create_default_psql_dependencies()
scripts/core/helm_handler.py
View file @
62834a9d
...
@@ -22,15 +22,13 @@ class HelmHandler:
...
@@ -22,15 +22,13 @@ class HelmHandler:
global_config_vars
=
global_config_data
.
get
(
'data'
,
{})
global_config_vars
=
global_config_data
.
get
(
'data'
,
{})
existing_env_variables
=
{
_v
[
'name'
]:
_v
for
_v
in
existing_env_variables
=
{
_v
[
'name'
]:
_v
for
_v
in
existing_data
.
get
(
'deployment'
,
{})
.
get
(
'environmentVar'
,
[])}
existing_data
.
get
(
'deployment'
,
{})
.
get
(
'environmentVar'
,
[])}
existing_data
[
'deployment'
][
'environmentVar'
]
=
[]
diff_keys
=
list
(
set
(
existing_env_variables
.
keys
())
.
symmetric_difference
(
set
(
module_env_variables
.
keys
())))
for
k
,
v
in
module_env_variables
.
items
():
for
_each
in
diff_keys
:
if
k
.
lower
()
in
{
'port'
,
'service_port'
,
'module_port'
}
and
v
.
get
(
"value"
):
if
_each
.
lower
()
in
{
'port'
,
'service_port'
,
'module_port'
}
and
module_env_variables
[
_each
]
.
get
(
global_config_vars
[
"SERVICE_PORT"
]
=
v
[
'value'
]
"value"
):
global_config_vars
[
"SERVICE_PORT"
]
=
module_env_variables
[
_each
][
"value"
]
continue
continue
if
"valueFrom"
in
existing_env_variables
.
get
(
k
,
[]):
existing_data
[
'deployment'
][
'environmentVar'
]
.
append
(
module_env_variables
[
_each
])
existing_data
[
'deployment'
][
'environmentVar'
]
.
append
(
existing_env_variables
[
k
])
else
:
existing_data
[
'deployment'
][
'environmentVar'
]
.
append
(
v
)
existing_data
[
'deployment'
][
'imageName'
]
=
image_tag
or
existing_data
[
'deployment'
][
'imageName'
]
existing_data
[
'deployment'
][
'imageName'
]
=
image_tag
or
existing_data
[
'deployment'
][
'imageName'
]
self
.
common_utils
.
convert_json_to_yaml
(
json_data
=
existing_data
,
output_file_path
=
template_file
)
self
.
common_utils
.
convert_json_to_yaml
(
json_data
=
existing_data
,
output_file_path
=
template_file
)
...
...
scripts/db/psql/models/__init__.py
View file @
62834a9d
...
@@ -4,7 +4,7 @@ from scripts.db.psql.databases import Base
...
@@ -4,7 +4,7 @@ from scripts.db.psql.databases import Base
class
ILensVersionTable
(
Base
):
class
ILensVersionTable
(
Base
):
__tablename__
=
"ilens_version_
tags
"
__tablename__
=
"ilens_version_
release
"
id
=
Column
(
Integer
,
autoincrement
=
True
,
primary_key
=
True
)
id
=
Column
(
Integer
,
autoincrement
=
True
,
primary_key
=
True
)
module_name
=
Column
(
String
,
index
=
True
,
nullable
=
False
)
module_name
=
Column
(
String
,
index
=
True
,
nullable
=
False
)
...
@@ -13,6 +13,6 @@ class ILensVersionTable(Base):
...
@@ -13,6 +13,6 @@ class ILensVersionTable(Base):
release_version
=
Column
(
Integer
,
nullable
=
False
)
release_version
=
Column
(
Integer
,
nullable
=
False
)
feature_version
=
Column
(
Integer
,
nullable
=
False
)
feature_version
=
Column
(
Integer
,
nullable
=
False
)
patch_version
=
Column
(
Integer
,
nullable
=
False
)
patch_version
=
Column
(
Integer
,
nullable
=
False
)
image_
tag
=
Column
(
String
,
nullable
=
False
)
image_
url
=
Column
(
String
,
nullable
=
False
)
last_
updated_at
=
Column
(
TIMESTAMP
(
timezone
=
True
),
nullable
=
False
,
index
=
True
)
updated_at
=
Column
(
TIMESTAMP
(
timezone
=
True
),
nullable
=
False
,
index
=
True
)
__table_args__
=
(
Index
(
'version_index'
,
"module_name"
,
"client"
),)
__table_args__
=
(
Index
(
'version_index'
,
"module_name"
,
"client"
),)
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