Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
app_install
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
tarun.madamanchi
app_install
Commits
39222a0c
Commit
39222a0c
authored
Jan 11, 2024
by
tarun2512
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fourth commit
parent
b37d0351
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
app_clone_script_copy.py
app_clone_script_copy.py
+20
-0
No files found.
app_clone_script_copy.py
View file @
39222a0c
...
...
@@ -104,6 +104,11 @@ def push_app_category(folder_path, folder_name, user_details, project_id, prefix
old_app_category_id
=
app_category
.
get
(
"app_category_id"
)
if
app_category
.
get
(
'name'
)
in
existed_app_category_mapping_data
:
app_category_data
=
existed_app_category_mapping_data
.
get
(
app_category
.
get
(
"name"
))
app_category_data
[
"project_id"
]
=
project_id
app_category_data
[
'created_at'
]
=
time
.
time
()
app_category_data
[
'created_by'
]
=
user_details
.
get
(
'user_id'
,
''
)
query
=
{
"app_category_id"
:
app_category_data
.
get
(
"app_category_id"
)}
connection
.
category_apps
.
update_one
(
query
,
{
"$set"
:
app_category_data
},
upsert
=
True
)
app_category_mapping
[
old_app_category_id
]
=
app_category_data
.
get
(
"app_category_id"
)
continue
app_category
[
"project_id"
]
=
project_id
...
...
@@ -322,6 +327,9 @@ def push_unit_group(folder_path, folder_name, project_id, prefix=None):
old_unit_group_id
=
unit_group
.
get
(
"id"
)
if
unit_group
.
get
(
'group_name'
)
in
existed_unit_group_mapping_data
:
unit_group_data
=
existed_unit_group_mapping_data
.
get
(
unit_group
.
get
(
"group_name"
))
unit_group_data
[
"project_id"
]
=
project_id
query
=
{
"id"
:
unit_group_data
.
get
(
"id"
)}
connection
.
units_group
.
update_one
(
query
,
{
"$set"
:
unit_group_data
},
upsert
=
True
)
unit_group_mapping
[
old_unit_group_id
]
=
unit_group_data
.
get
(
"id"
)
continue
unit_group
[
"project_id"
]
=
project_id
...
...
@@ -354,6 +362,8 @@ def push_units(folder_path, collection_data, project_id, prefix=None):
old_unit_id
=
unit
.
get
(
"id"
)
if
unit
.
get
(
'name'
)
in
existed_unit_mapping_data
:
unit_data
=
existed_unit_mapping_data
.
get
(
unit
.
get
(
"name"
))
query
=
{
"id"
:
unit_data
.
get
(
"id"
)}
connection
.
units
.
update_one
(
query
,
{
"$set"
:
unit_data
},
upsert
=
True
)
unit_id_mapping
[
old_unit_id
]
=
unit_data
.
get
(
"id"
)
continue
unit
[
"project_id"
]
=
project_id
...
...
@@ -385,6 +395,8 @@ def push_tag_category(folder_path, folder_name, prefix=None):
old_tag_category_id
=
tag_category
.
get
(
"tag_category_id"
)
if
tag_category
.
get
(
'tag_category_name'
)
in
existed_tag_category_mapping_data
:
tag_category_data
=
existed_tag_category_mapping_data
.
get
(
tag_category
.
get
(
"tag_category_name"
))
query
=
{
"tag_category_id"
:
tag_category_data
.
get
(
"tag_category_id"
)}
connection
.
tag_category
.
update_one
(
query
,
{
"$set"
:
tag_category_data
},
upsert
=
True
)
tag_category_mapping
[
old_tag_category_id
]
=
tag_category_data
.
get
(
"tag_category_id"
)
continue
tag_category
[
"tag_category_id"
]
=
"tag_category_"
+
str
(
get_next_id
(
"tag_category"
,
prefix
))
...
...
@@ -414,6 +426,8 @@ def push_tag_group(folder_path, folder_name, prefix=None):
old_tag_group_id
=
tag_group
.
get
(
"tag_group_id"
)
if
tag_group
.
get
(
'tag_group_name'
)
in
existed_tag_group_mapping_data
:
tag_group_data
=
existed_tag_group_mapping_data
.
get
(
tag_group
.
get
(
"tag_group_name"
))
query
=
{
"tag_group_id"
:
tag_group_data
.
get
(
"tag_group_id"
)}
connection
.
tag_groups
.
update_one
(
query
,
{
"$set"
:
tag_group_data
},
upsert
=
True
)
tag_group_mapping
[
old_tag_group_id
]
=
tag_group_data
.
get
(
"tag_group_id"
)
continue
tag_group
[
"tag_group_id"
]
=
"tag_group_"
+
str
(
get_next_id
(
"tag_group"
,
prefix
))
...
...
@@ -447,6 +461,12 @@ def push_parameters(folder_path, collection_data, unit_id_mapping, project_id, p
old_tag_id
=
tag
.
get
(
"tag_id"
)
if
tag
[
'tag_name'
]
in
existed_tag_mapping_data
:
tag_data
=
existed_tag_mapping_data
.
get
(
tag
.
get
(
"tag_name"
))
tag_data
[
"project_id"
]
=
project_id
tag_data
[
"tag_group_id"
]
=
tag_group_mapping
.
get
(
tag_data
.
get
(
"tag_group_id"
),
tag_data
.
get
(
"tag_group_id"
))
tag_data
[
"tag_category_id"
]
=
tag_category_mapping
.
get
(
tag_data
.
get
(
"tag_category_id"
),
tag_data
.
get
(
"tag_category_id"
))
tag_data
[
'unit'
]
=
unit_id_mapping
.
get
(
tag_data
.
get
(
"unit"
),
tag_data
.
get
(
"unit"
))
query
=
{
"tag_id"
:
tag_data
.
get
(
"tag_id"
)}
connection
.
tags
.
update_one
(
query
,
{
"$set"
:
tag_data
},
upsert
=
True
)
parameter_id_mapping
[
old_tag_id
]
=
tag_data
.
get
(
"tag_id"
)
continue
tag
[
"project_id"
]
=
project_id
...
...
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