This is an automated email from the ASF dual-hosted git repository.

joemcdonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit f1fd72a8ee6334711f381af887619d13cfa3f5b3
Author: Fredy Wijaya <fwij...@cloudera.com>
AuthorDate: Wed Feb 27 18:21:48 2019 -0800

    IMPALA-8261: Enhance create-test-configuration.sh to not fail when FE has 
not been built
    
    This patch updates create-test-configuration.sh to not fail due to
    missing PostgreSQL JDBC driver when FE has not been built by
    downloading it from Maven Central instead. When the JDBC driver
    already exists in ${POSTGRES_JDBC_DRIVER}, it will use that instead.
    
    Testing:
    Manually ran create-test-configuration.sh with and without FE built.
    
    Change-Id: I6536dcffc1124e79c1ed111ad92d257493cc8feb
    Reviewed-on: http://gerrit.cloudera.org:8080/12630
    Reviewed-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
    Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
---
 bin/create-test-configuration.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/bin/create-test-configuration.sh b/bin/create-test-configuration.sh
index fc2207d..80e6b92 100755
--- a/bin/create-test-configuration.sh
+++ b/bin/create-test-configuration.sh
@@ -206,7 +206,15 @@ cp -f "${RANGER_TEST_CONF_DIR}/ranger-admin-env-logdir.sh" 
"${RANGER_SERVER_CONF
 cp -f "${RANGER_TEST_CONF_DIR}/ranger-admin-env-piddir.sh" 
"${RANGER_SERVER_CONF_DIR}"
 cp -f "${RANGER_TEST_CONF_DIR}/security-applicationContext.xml" \
     "${RANGER_SERVER_CONF_DIR}"
-cp -f "${POSTGRES_JDBC_DRIVER}" "${RANGER_SERVER_LIB_DIR}"
+if [[ -f "${POSTGRES_JDBC_DRIVER}" ]]; then
+  cp -f "${POSTGRES_JDBC_DRIVER}" "${RANGER_SERVER_LIB_DIR}"
+else
+  # IMPALA-8261: Running this script should not fail when FE has not been 
built.
+  MAVEN_URL="http://central.maven.org/maven2/postgresql/postgresql";
+  JDBC_JAR="postgresql-${IMPALA_POSTGRES_JDBC_DRIVER_VERSION}.jdbc4.jar"
+  wget -P "${RANGER_SERVER_LIB_DIR}" \
+    "${MAVEN_URL}/${IMPALA_POSTGRES_JDBC_DRIVER_VERSION}.jdbc4/${JDBC_JAR}"
+fi
 
 pushd "${RANGER_SERVER_CONF_DIR}"
 generate_config 
"${RANGER_TEST_CONF_DIR}/ranger-admin-default-site.xml.template" \

Reply via email to