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
0b1ce30f
Commit
0b1ce30f
authored
Jan 24, 2024
by
tarun2512
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fourth commit
parent
def51ec8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
app_clone_script_new.py
app_clone_script_new.py
+11
-5
No files found.
app_clone_script_new.py
View file @
0b1ce30f
...
...
@@ -14,10 +14,8 @@ print(f'ROOT PATH ---> {root_path}')
sys
.
path
.
append
(
root_path
)
MONGO_URI
=
os
.
environ
.
get
(
"MONGO_URI"
)
USER_ID
=
os
.
environ
.
get
(
"USER_ID"
)
PROJECT_ID
=
os
.
environ
.
get
(
"PROJECT_ID"
)
PROJECT_NAME
=
os
.
environ
.
get
(
"PROJECT_NAME"
)
APP_NAME
=
os
.
environ
.
get
(
"APP_NAME"
)
PREFIX
=
os
.
environ
.
get
(
"PREFIX"
)
BASE_PATH
=
os
.
environ
.
get
(
"BASE_PATH"
)
MOUNT_DIR
=
os
.
environ
.
get
(
"MOUNT_DIR"
)
...
...
@@ -44,6 +42,7 @@ class Connection(Database):
self
.
customer_apps
=
self
.
configuration
[
"customer_apps"
]
self
.
lookup_table
=
self
.
configuration
[
"lookup_table"
]
self
.
category_apps
=
self
.
configuration
[
"category_apps"
]
self
.
customer_project
=
self
.
configuration
[
"customer_projects"
]
self
.
dashboard_category
=
self
.
widget
[
"category"
]
self
.
widget_col
=
self
.
widget
[
"widget"
]
self
.
user_conn
=
self
.
configuration
[
"user"
]
...
...
@@ -291,7 +290,14 @@ def push_data(folder_path, collection_data, user_id, project_id, prefix=None):
move_images
([
f
"{folder1_path}/{image1_path[0]}"
,
f
"{folder2_path}/{image2_path[0]}"
],
destination_folder
)
def
extract_app_zip
(
app_name
,
user_id
,
project_id
,
prefix
=
None
):
def
extract_app_zip
(
app_name
,
project_name
):
connection
=
Connection
()
project_details
=
connection
.
customer_project
.
find_one
({
"customer_project_name"
:
project_name
},
{
"_id"
:
0
})
user_id
=
project_details
.
get
(
"user_id"
)
project_id
=
project_details
.
get
(
"customer_project_id"
)
prefix
=
None
if
project_details
.
get
(
"add_prefix_to_database"
):
prefix
=
project_id
zip_path
=
os
.
path
.
join
(
BASE_PATH
,
MOUNT_DIR
,
f
"{app_name}.zip"
)
folder_path
=
os
.
path
.
join
(
BASE_PATH
,
MOUNT_DIR
,
app_name
)
CloneScriptHelper
()
.
unzip_file
(
zip_path
,
folder_path
)
...
...
@@ -305,4 +311,4 @@ def extract_app_zip(app_name, user_id, project_id, prefix=None):
if
__name__
==
"__main__"
:
extract_app_zip
(
APP_NAME
,
USER_ID
,
PROJECT_ID
,
PREFIX
)
extract_app_zip
(
APP_NAME
,
PROJECT_NAME
)
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