You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/06/07 13:59:02 UTC

[GitHub] [airflow] mik-laj commented on a change in pull request #9167: Improved cloud tool available in the trimmed down CI container

mik-laj commented on a change in pull request #9167:
URL: https://github.com/apache/airflow/pull/9167#discussion_r436366035



##########
File path: scripts/ci/prepare_tool_scripts.sh
##########
@@ -0,0 +1,58 @@
+#!/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
+#
+#   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.
+set -euo pipefail
+
+function prepare_tool_script() {
+    IMAGE="${1}"
+    VOLUME="${2}"
+    TOOL="${3}"
+    COMMAND="${4:-}"
+
+    TARGET_TOOL_PATH="/usr/bin/${TOOL}"
+    TARGET_TOOL_UPDATE_PATH="/usr/bin/${TOOL}-update"
+
+    cat >"${TARGET_TOOL_PATH}" <<EOF
+#!/usr/bin/env bash

Review comment:
       What do you think about creating one generic script and many symbolic links? This one script can select an image based on "basename "${BASH_SOURCE[0]}".  If it detects suffix "-update" it will update the image.  The script can be located in one file e.g. scripts/ci/in_container/run_cli_tools.sh.




----------------------------------------------------------------
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:
users@infra.apache.org