Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
app_zip
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_zip
Commits
0eab31a7
Commit
0eab31a7
authored
Jan 24, 2024
by
tarun2512
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
third commit
parent
e76ae6a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
app_publish_script.py
app_publish_script.py
+16
-0
No files found.
app_publish_script.py
View file @
0eab31a7
...
...
@@ -55,6 +55,7 @@ class Connection(Database):
self
.
tags
=
self
.
configuration
[
"tags"
]
self
.
tag_groups
=
self
.
configuration
[
"tag_groups"
]
self
.
tag_category
=
self
.
configuration
[
"tag_category"
]
self
.
rule_targets
=
self
.
configuration
[
"rule_targets"
]
def
iterate_through_children_mapping
(
each_children_obj
,
required_ids
,
required_type
):
...
...
@@ -355,6 +356,20 @@ def app_image_zip(images, folder_path):
print
(
f
"Failed to download image. Status code: {response.status_code}"
)
def
rule_target_zip
(
app_name
,
project_id
,
prefix
=
None
):
connection
=
Connection
(
prefix
=
prefix
)
database
=
Database
(
prefix
=
prefix
)
folder_path
=
os
.
path
.
join
(
BASE_PATH
,
MOUNT_DIR
,
app_name
)
rule_target_details
=
list
(
connection
.
rule_targets
.
find
({
"target_type"
:
"rest"
,
"project_id"
:
project_id
},
{
"_id"
:
0
}))
rule_target_folder
=
f
"{database.configuration.name}.rule_targets"
rule_target_data_folder_path
=
os
.
path
.
join
(
folder_path
,
rule_target_folder
)
os
.
makedirs
(
rule_target_data_folder_path
)
rule_target_file_path
=
os
.
path
.
join
(
rule_target_data_folder_path
,
f
"{rule_target_folder}.json"
)
with
open
(
rule_target_file_path
,
'w'
)
as
file
:
json
.
dump
(
rule_target_details
,
file
)
file
.
close
()
def
app_zip
(
app_name
,
project_id
,
prefix
=
None
):
connection
=
Connection
(
prefix
=
prefix
)
database
=
Database
(
prefix
=
prefix
)
...
...
@@ -377,6 +392,7 @@ def app_zip(app_name, project_id, prefix=None):
app_category_zip
(
app_data
,
folder_path
,
project_id
,
prefix
)
modify_app_data
(
app_data
)
app_image_zip
(
images
,
folder_path
)
rule_target_zip
(
app_name
,
project_id
,
prefix
)
app_data_folder
=
f
"{database.configuration.name}.customer_apps"
app_data_folder_path
=
os
.
path
.
join
(
folder_path
,
app_data_folder
)
os
.
makedirs
(
app_data_folder_path
)
...
...
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