ashb commented on a change in pull request #4938: [AIRFLOW-4117] Multi-staging Image - Travis CI tests [Step 3/3] URL: https://github.com/apache/airflow/pull/4938#discussion_r299481245
########## File path: scripts/ci/in_container/entrypoint_ci.sh ########## @@ -0,0 +1,220 @@ +#!/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. + +# Bash sanity settings (error on exit, complain for undefined vars, error when pipe fails) +set -euo pipefail +MY_DIR=$(cd "$(dirname "$0")"; pwd) + +if [[ ${AIRFLOW_CI_VERBOSE:="false"} == "true" ]]; then + set -x +fi + +# shellcheck source=./_check_in_container.sh +. ${MY_DIR}/_check_in_container.sh + +AIRFLOW_ROOT="${MY_DIR}/../.." + +PYTHON_VERSION=${PYTHON_VERSION:=3.6} +ENV=${ENV:=docker} +BACKEND=${BACKEND:=sqlite} +KUBERNETES_VERSION=${KUBERNETES_VERSION:=""} + +export AIRFLOW_HOME=${AIRFLOW_HOME:=${HOME}} + +if [[ -z "${AIRFLOW_SOURCES:=}" ]]; then + echo + echo AIRFLOW_SOURCES not set !!!! + echo + exit 1 +fi + +echo +echo "Airflow home: ${AIRFLOW_HOME}" +echo "Airflow sources: ${AIRFLOW_SOURCES}" +echo "Airflow core SQL connection: ${AIRFLOW__CORE__SQL_ALCHEMY_CONN:=}" +echo + +ARGS=( "$@" ) + +RUN_TESTS=${RUN_TESTS:="true"} + +if [[ ! -d "${AIRFLOW_SOURCES}/airflow/www/node_modules" && "${CLEAN_FILES}" == "false" ]]; then + echo + echo "Installing NPM modules as they are not yet installed (Sources mounted from Host)" + echo + pushd "${AIRFLOW_SOURCES}/airflow/www/" + npm ci + echo + popd +fi +if [[ ! -d "${AIRFLOW_SOURCES}/airflow/www/static/dist" && ${CLEAN_FILES} == "false" ]]; then + pushd "${AIRFLOW_SOURCES}/airflow/www/" + echo + echo "Building production version of javascript files (Sources mounted from Host)" + echo + echo + npm run prod + echo + echo + popd +fi + +if [[ ${AIRFLOW_CI_VERBOSE} == "true" ]]; then + echo + echo "Using ${HADOOP_DISTRO:=} distribution of Hadoop from ${HADOOP_HOME:=}" + echo +fi + +AIRFLOW_ROOT="$(cd ${MY_DIR}; cd ../../..; pwd)" + +export AIRFLOW__CORE__DAGS_FOLDER="${AIRFLOW_SOURCES}/tests/dags" + +# add test/test_utils to PYTHONPATH (TODO: Do we need it?) +export PYTHONPATH=${PYTHONPATH:-${AIRFLOW_SOURCES}/tests/test_utils} Review comment: I mean why do we set this in two places? ---------------------------------------------------------------- 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