potiuk commented on a change in pull request #9219:
URL: https://github.com/apache/airflow/pull/9219#discussion_r438432062



##########
File path: scripts/ci/prepare_tool_scripts.sh
##########
@@ -29,19 +29,28 @@ function prepare_tool_script() {
 
     cat >"${TARGET_TOOL_PATH}" <<EOF
 #!/usr/bin/env bash
-docker run --rm -it \
-    -v "\${HOST_AIRFLOW_SOURCES}/tmp:/tmp" \
-    -v "\${HOST_AIRFLOW_SOURCES}/files:/files" \
-    -v "\${HOST_AIRFLOW_SOURCES}:/opt/airflow" \
-    -v "\${HOST_HOME}/${VOLUME}:/root/${VOLUME}" \
-    "${IMAGE}" ${COMMAND} "\$@"
+DOCKER_ARGS=(
+    -v "\${HOST_AIRFLOW_SOURCES}/tmp:/tmp" \\
+    -v "\${HOST_AIRFLOW_SOURCES}/files:/files" \\
+    -v "\${HOST_AIRFLOW_SOURCES}:/opt/airflow" \\
+    -v "\${HOST_HOME}/${VOLUME}:/root/${VOLUME}" \\
+    --interactive \\
+)
+if [ -t 0 ] ; then
+    DOCKER_ARGS+=(
+        --tty \\
+    )
+fi
+
+docker run "\${DOCKER_ARGS[@]}" "${IMAGE}" "\${@}"
+
 RES=\$?
 if [[ \${HOST_OS} == "Linux" ]]; then
     docker run --rm \
-        -v "\${HOST_AIRFLOW_SOURCES}/tmp:/tmp" \
-        -v "\${HOST_AIRFLOW_SOURCES}/files:/files" \
-        -v "\${HOST_HOME}/${VOLUME}:/root/${VOLUME}" \
-        "\${AIRFLOW_CI_IMAGE}" bash -c \
+        -v "\${HOST_AIRFLOW_SOURCES}/tmp:/tmp" \\

Review comment:
       We dd not want a new line here - the idea is that it gets converted to a 
single line in generated scripts, But this way it will work as well. So no 
problem with that.




----------------------------------------------------------------
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:
[email protected]


Reply via email to