potiuk commented on a change in pull request #9219:
URL: https://github.com/apache/airflow/pull/9219#discussion_r438434218
##########
File path: scripts/ci/prepare_tool_scripts.sh
##########
@@ -59,9 +68,60 @@
GCLOUD_IMAGE="gcr.io/google.com/cloudsdktool/cloud-sdk:latest"
prepare_tool_script "amazon/aws-cli:latest" ".aws" aws
prepare_tool_script "mcr.microsoft.com/azure-cli:latest" ".azure" az az
-prepare_tool_script "${GCLOUD_IMAGE}" ".config/gcloud" bq bq
-prepare_tool_script "${GCLOUD_IMAGE}" ".config/gcloud" gcloud gcloud
-prepare_tool_script "${GCLOUD_IMAGE}" ".config/gcloud" gsutil gsutil
+
+function prepare_gcloud_script() {
+ IMAGE="${1}"
+ TOOL="${2}"
+ COMMAND="${2}"
+ VOLUME=".config/gcloud"
+
+ TARGET_TOOL_PATH="/usr/bin/${TOOL}"
+ TARGET_TOOL_UPDATE_PATH="/usr/bin/${TOOL}-update"
+
+ cat >"${TARGET_TOOL_PATH}" <<EOF
+#!/usr/bin/env bash
+
+DOCKER_ARGS=(
+ --rm \\
+ -v "\${HOST_AIRFLOW_SOURCES}/tmp:/tmp" \\
+ -v "\${HOST_AIRFLOW_SOURCES}/files:/files" \\
+ -v "\${HOST_AIRFLOW_SOURCES}:/opt/airflow" \\
+ -v "\${HOST_HOME}/${VOLUME}:/root/${VOLUME}" \\
+ -e GOOGLE_APPLICATION_CREDENTIALS \\
+ -e CLOUDSDK_CONFIG \\
Review comment:
I think we should do it differently. We shoudl simplify all the scripts
to the same form now - having separate script for each function defeats the
purpose.
----------------------------------------------------------------
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]