Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Airflow
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Margrenzo Gunawan
Airflow
Commits
77039e0d
Commit
77039e0d
authored
Sep 02, 2024
by
Timothy Ardha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add and update mgate's zip and delete function
parent
4c019de7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
1_mgate.py
1_mgate.py
+13
-6
No files found.
1_mgate.py
View file @
77039e0d
...
...
@@ -159,10 +159,10 @@ with DAG("APJ_1_mgate",
op_kwargs
=
{},
)
remove_fil
e_before
=
BashOperator
(
task_id
=
"
remove_fil
e_before"
,
delet
e_before
=
BashOperator
(
task_id
=
"
delet
e_before"
,
bash_command
=
f"""
cd
{
Variable
.
get
(
"LOCAL_PATH"
)
}{
DS_FOLDER
}
/
{
yesterday_lusa
}
/ && rm
{
yesterday_lusa
}
*
cd
{
Variable
.
get
(
"LOCAL_PATH"
)
}{
DS_FOLDER
}
/
&& rm
{
yesterday_lusa
}
.zip
"""
)
...
...
@@ -266,10 +266,17 @@ with DAG("APJ_1_mgate",
"""
,
)
delete_before
=
BashOperator
(
zip_today
=
BashOperator
(
task_id
=
"zip_today"
,
bash_command
=
f"""
cd /opt/airflow/dags/DFE/
{
DS_FOLDER
}
/ && zip -r
{
yesterday_nodash
}
.zip
{
yesterday_nodash
}
;
"""
)
delete_today
=
BashOperator
(
task_id
=
"delete_before"
,
bash_command
=
f"""
rm -rf /opt/airflow/dags/DFE/
{
DS_FOLDER
}
/
{
yesterday_
lusa
}
;
rm -rf /opt/airflow/dags/DFE/
{
DS_FOLDER
}
/
{
yesterday_
nodash
}
;
"""
,
)
...
...
@@ -285,4 +292,4 @@ with DAG("APJ_1_mgate",
begin
>>
check_done_ext
>>
remove_file_before
>>
history_start
>>
create_folder
>>
ds_list_extractor
>>
ds_get_syntax
>>
ds_table_to_csv
>>
ds_get_ddl
>>
pg_drop_schema
>>
pg_create_schema
>>
pg_ddl_syntax
>>
pg_create_table
>>
pg_push_syntax
>>
pg_csv_to_table
>>
set_access_schemma
>>
set_access_all_table
>>
ds_ext_done
>>
delete_before
>>
history_finish
\ No newline at end of file
begin
>>
check_done_ext
>>
delete_before
>>
history_start
>>
create_folder
>>
ds_list_extractor
>>
ds_get_syntax
>>
ds_table_to_csv
>>
ds_get_ddl
>>
pg_drop_schema
>>
pg_create_schema
>>
pg_ddl_syntax
>>
pg_create_table
>>
pg_push_syntax
>>
pg_csv_to_table
>>
set_access_schemma
>>
set_access_all_table
>>
ds_ext_done
>>
zip_today
>>
delete_today
>>
history_finish
\ No newline at end of file
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