potiuk commented on a change in pull request #5807: [AIRFLOW-5204] Shellcheck + common licence in shell files URL: https://github.com/apache/airflow/pull/5807#discussion_r314178750
########## File path: airflow/example_dags/entrypoint.sh ########## @@ -1,20 +1,20 @@ -# -*- coding: utf-8 -*- +#!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 # -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. -["/bin/bash", "-c", "/bin/sleep 30; /bin/mv {{params.source_location}}/{{ ti.xcom_pull('view_file') }} {{params.target_location}}; /bin/echo '{{params.target_location}}/{{ ti.xcom_pull('view_file') }}';"] +# TODO: Uncomment this code when we start using it +#[ "/bin/bash", "-c", "/bin/sleep 30; /bin/mv {{params.source_location}}/{{ ti.xcom_pull('view_file') }} {{params.target_location}}; /bin/echo '{{params.target_location}}/{{ ti.xcom_pull('view_file') }}';" ] # shellcheck disable=SC1073,SC1072,SC1035 Review comment: This is a problematic implementation of DockerOperator w/regards to command. The command can be either a string or array. It can be templated and it can also ba a file with .bash or .sh extension. In this case the python array was stored in a file with .sh extension - that was valid from the DockerOPerator point of view (see docker_copy_data.py) but it makes little sense to store an array in .sh file. Those tests in docker_copy_data.py were anyhow commented out with suggestion to uncomment if you want to run your own testing. Rather than commenting out I simply moved the array to docker_copy_data.py and removed the entrypoint.sh now ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services