-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ecbbad9
commit 0f9bb31
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from datetime import datetime | ||
|
||
from airflow.decorators import dag | ||
from airflow.models.param import Param | ||
|
||
from rikolti.dags.shared_tasks.indexing_tasks import ( | ||
publish_collection_task, get_version_pages) | ||
from rikolti.dags.shared_tasks.shared import get_registry_data_task | ||
from rikolti.dags.shared_tasks.shared import notify_dag_success | ||
from rikolti.dags.shared_tasks.shared import notify_dag_failure | ||
|
||
|
||
@dag( | ||
dag_id="publish_collection", | ||
schedule=None, | ||
start_date=datetime(2023, 1, 1), | ||
catchup=False, | ||
params={ | ||
'collection_id': Param(None, description="Collection ID to publish"), | ||
'version': Param(None, description="Version path to publish") | ||
}, | ||
tags=["rikolti"], | ||
on_failure_callback=notify_dag_failure, | ||
on_success_callback=notify_dag_success, | ||
) | ||
def publish_collection_dag(): | ||
collection = get_registry_data_task() | ||
version_pages = get_version_pages() | ||
publish_collection_task(collection, version_pages) | ||
|
||
publish_collection_dag() |