diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 862ece7f7db2b252dac063cb1aca4aa3fb116382..39994fe8889520f3b8b0b83fe232b9acfa03ee49 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,6 +23,6 @@ test: - cp dags/* /opt/airflow/dags/ - airflow dags list - airflow connections list - - airflow dags test firsto 2021-08-18 + - airflow dags test testdag 2021-08-18 - nosetests diff --git a/dags/testdag.py b/dags/testdag.py new file mode 100644 index 0000000000000000000000000000000000000000..bcecf078ee8115bf685389a92f4231f296efc6ee --- /dev/null +++ b/dags/testdag.py @@ -0,0 +1,21 @@ +from datetime import timedelta + +from airflow import DAG +from airflow.operators.bash import BashOperator +from airflow.utils.dates import days_ago + +def_args = { + 'owner': 'airflow', + 'depends_on_past': False, + 'email_on_failure': False, + 'email_on_retry': False, + 'retries': 1, + 'retry_delay': timedelta(minutes=5) + +} + +with DAG('firsto', default_args=def_args, description='first dag', schedule_interval=timedelta(days=1), start_date=days_ago(2)) as dag: + t1 = BashOperator(task_id='print_date', bash_command='date') + t2 = BashOperator(task_id='do_noting', bash_command='sleep 5') + + t1 >> t2