diff --git a/dags/business/dag_comm_add.py b/dags/business/dag_comm_add.py index 4dbed8e..5324e83 100644 --- a/dags/business/dag_comm_add.py +++ b/dags/business/dag_comm_add.py @@ -10,10 +10,14 @@ with DAG( description="小区自动化入库" ) as dag: t1 = DockerOperator( + # 刚才定义的conn id docker_conn_id="docker_repo", api_version="auto", image='192.168.0.19:9012/comm-add:1.0.1', - command='python main.py --city 临沂', + # 临沂为我们的传参,python代码中, 镜像中部分代码 + # @ click.command() + # @ click.option('--city', default="all", help='要计算的城市') + command='python main.py --city {{dag_run.conf["city"] if "city" in dag_run.conf}} else all', task_id='comm_add' ) t1 \ No newline at end of file