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
49a0eb81
Commit
49a0eb81
authored
Jan 12, 2024
by
tarun2512
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fourth commit
parent
309c2619
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
app.py
app.py
+26
-0
image_move_script.py
image_move_script.py
+1
-0
No files found.
app.py
0 → 100644
View file @
49a0eb81
from
dotenv
import
load_dotenv
import
os
load_dotenv
()
from
app_clone_script_copy
import
extract_app_zip
from
image_move_script
import
get_image_names
,
move_images
USER_ID
=
os
.
environ
.
get
(
"USER_ID"
)
PROJECT_ID
=
os
.
environ
.
get
(
"PROJECT_ID"
)
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"
)
folder1_path
=
os
.
path
.
join
(
BASE_PATH
,
MOUNT_DIR
,
APP_NAME
,
"app_image"
)
folder2_path
=
os
.
path
.
join
(
BASE_PATH
,
MOUNT_DIR
,
APP_NAME
,
"app_logo"
)
destination_folder
=
os
.
path
.
join
(
BASE_PATH
,
"metadata/images/apps"
)
if
__name__
==
"__main__"
:
extract_app_zip
(
APP_NAME
,
USER_ID
,
PROJECT_ID
,
PREFIX
)
image1_path
=
get_image_names
(
folder1_path
)
image2_path
=
get_image_names
(
folder2_path
)
if
image1_path
and
image2_path
:
# Call the function with the list of image paths and the destination folder
move_images
([
f
"{folder1_path}/{image1_path[0]}"
,
f
"{folder2_path}/{image2_path[0]}"
],
destination_folder
)
\ No newline at end of file
image_move_script.py
View file @
49a0eb81
...
@@ -11,6 +11,7 @@ folder1_path = os.path.join(BASE_PATH, MOUNT_DIR, APP_NAME, "app_image")
...
@@ -11,6 +11,7 @@ folder1_path = os.path.join(BASE_PATH, MOUNT_DIR, APP_NAME, "app_image")
folder2_path
=
os
.
path
.
join
(
BASE_PATH
,
MOUNT_DIR
,
APP_NAME
,
"app_logo"
)
folder2_path
=
os
.
path
.
join
(
BASE_PATH
,
MOUNT_DIR
,
APP_NAME
,
"app_logo"
)
destination_folder
=
os
.
path
.
join
(
BASE_PATH
,
"metadata/images/apps"
)
destination_folder
=
os
.
path
.
join
(
BASE_PATH
,
"metadata/images/apps"
)
def
get_image_names
(
folder_path
):
def
get_image_names
(
folder_path
):
try
:
try
:
# List all files in the folder
# List all files in the folder
...
...
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