From 27bb7ff5db2be892c9a7aa8880a01a907572a7e1 Mon Sep 17 00:00:00 2001 From: Dave Page Date: Mon, 25 Jun 2018 17:00:21 +0100 Subject: [PATCH] Don't use imple variable notation in bash scripts. --- ci/build_docs.sh | 8 ++++---- ci/build_pip_wheel.sh | 8 ++++---- ci/build_runtime_qt4.sh | 8 ++++---- ci/build_runtime_qt5.sh | 8 ++++---- ci/build_tarballs.sh | 10 +++++----- ci/ci_runner.sh | 18 +++++++++--------- ci/create_config.sh | 16 ++++++++-------- ci/run_feature_tests.sh | 24 ++++++++++++------------ ci/run_jasmine_tests.sh | 2 +- ci/run_python_tests.sh | 22 +++++++++++----------- ci/update_messages.sh | 4 ++-- 11 files changed, 64 insertions(+), 64 deletions(-) diff --git a/ci/build_docs.sh b/ci/build_docs.sh index 13b5cff35..30ca3d767 100755 --- a/ci/build_docs.sh +++ b/ci/build_docs.sh @@ -3,15 +3,15 @@ echo "EXECUTING: Build docs" echo -cd $WORKSPACE +cd ${WORKSPACE} -. $WORKSPACE/pgadmin-venv/bin/activate +. ${WORKSPACE}/pgadmin-venv/bin/activate SPHINX_VER="" -if [ "$PYTHON_VERSION" = "2.6" -o "$PYTHON_VERSION" = "3.3" ]; then +if [ "${PYTHON_VERSION}" = "2.6" -o "${PYTHON_VERSION}" = "3.3" ]; then SPHINX_VER="==1.4.9" fi -$WORKSPACE/pgadmin-venv/bin/pip install Sphinx$SPHINX_VER || { echo 'ERROR: Failed to install Sphinx to build the docs.' ; exit 1; } +${WORKSPACE}/pgadmin-venv/bin/pip install Sphinx${SPHINX_VER} || { echo 'ERROR: Failed to install Sphinx to build the docs.' ; exit 1; } make docs || { echo 'ERROR: Failed to build the documentation.' ; exit 1; } diff --git a/ci/build_pip_wheel.sh b/ci/build_pip_wheel.sh index 871b33df3..2e675d712 100755 --- a/ci/build_pip_wheel.sh +++ b/ci/build_pip_wheel.sh @@ -3,15 +3,15 @@ echo "EXECUTING: Build PIP wheel" echo -cd $WORKSPACE +cd ${WORKSPACE} -. $WORKSPACE/pgadmin-venv/bin/activate +. ${WORKSPACE}/pgadmin-venv/bin/activate SPHINX_VER="" -if [ "$PYTHON_VERSION" = "2.6" -o "$PYTHON_VERSION" = "3.3" ]; then +if [ "${PYTHON_VERSION}" = "2.6" -o "${PYTHON_VERSION}" = "3.3" ]; then SPHINX_VER="==1.4.9" fi -$WORKSPACE/pgadmin-venv/bin/pip install Sphinx$SPHINX_VER || { echo 'ERROR: Failed to install Sphinx to build the PIP wheel.' ; exit 1; } +${WORKSPACE}/pgadmin-venv/bin/pip install Sphinx${SPHINX_VER} || { echo 'ERROR: Failed to install Sphinx to build the PIP wheel.' ; exit 1; } make pip || { echo 'ERROR: Failed to build the PIP wheel.' ; exit 1; } \ No newline at end of file diff --git a/ci/build_runtime_qt4.sh b/ci/build_runtime_qt4.sh index e52e0a4b4..9ae069b27 100755 --- a/ci/build_runtime_qt4.sh +++ b/ci/build_runtime_qt4.sh @@ -4,13 +4,13 @@ echo "EXECUTING: Build runtime - QT4" echo if [ ${PYTHON_VERSION:0:1} == "3" ]; then - CONFIG=/usr/local/python-$PYTHON_VERSION/bin/python3-config + CONFIG=/usr/local/python-${PYTHON_VERSION}/bin/python3-config else - CONFIG=/usr/local/python-$PYTHON_VERSION/bin/python-config + CONFIG=/usr/local/python-${PYTHON_VERSION}/bin/python-config fi -cd $WORKSPACE/runtime +cd ${WORKSPACE}/runtime make clean -PATH=/usr/local/python-$PYTHON_VERSION/bin:$PATH PYTHON_CONFIG=$CONFIG /bin/qmake-qt4 || { echo 'ERROR: Failed to run the QT4 qmake step.' ; exit 1; } +PATH=/usr/local/python-${PYTHON_VERSION}/bin:$PATH PYTHON_CONFIG=${CONFIG} /bin/qmake-qt4 || { echo 'ERROR: Failed to run the QT4 qmake step.' ; exit 1; } make all || { echo 'ERROR: Failed to build the QT4 runtime.' ; exit 1; } diff --git a/ci/build_runtime_qt5.sh b/ci/build_runtime_qt5.sh index 5679ec41f..384372bff 100755 --- a/ci/build_runtime_qt5.sh +++ b/ci/build_runtime_qt5.sh @@ -4,13 +4,13 @@ echo "EXECUTING: Build runtime - QT5" echo if [ ${PYTHON_VERSION:0:1} == "3" ]; then - CONFIG=/usr/local/python-$PYTHON_VERSION/bin/python3-config + CONFIG=/usr/local/python-${PYTHON_VERSION}/bin/python3-config else - CONFIG=/usr/local/python-$PYTHON_VERSION/bin/python-config + CONFIG=/usr/local/python-${PYTHON_VERSION}/bin/python-config fi -cd $WORKSPACE/runtime +cd ${WORKSPACE}/runtime make clean -PATH=/usr/local/python-$PYTHON_VERSION/bin:$PATH PYTHON_CONFIG=$CONFIG /bin/qmake-qt5 DEFINES+=PGADMIN4_USE_WEBKIT || { echo 'ERROR: Failed to run the QT5 qmake step.' ; exit 1; } +PATH=/usr/local/python-${PYTHON_VERSION}/bin:$PATH PYTHON_CONFIG=${CONFIG} /bin/qmake-qt5 DEFINES+=PGADMIN4_USE_WEBKIT || { echo 'ERROR: Failed to run the QT5 qmake step.' ; exit 1; } make all || { echo 'ERROR: Failed to build the QT4 runtime.' ; exit 1; } diff --git a/ci/build_tarballs.sh b/ci/build_tarballs.sh index 317cc3eee..63d2cb9de 100755 --- a/ci/build_tarballs.sh +++ b/ci/build_tarballs.sh @@ -3,15 +3,15 @@ echo "EXECUTING: Build Tarballs" echo -cd $WORKSPACE +cd ${WORKSPACE} -. $WORKSPACE/pgadmin-venv/bin/activate +. ${WORKSPACE}/pgadmin-venv/bin/activate SPHINX_VER="" -if [ "$PYTHON_VERSION" = "2.6" -o "$PYTHON_VERSION" = "3.3" ]; then +if [ "${PYTHON_VERSION}" = "2.6" -o "${PYTHON_VERSION}" = "3.3" ]; then SPHINX_VER="==1.4.9" fi -$WORKSPACE/pgadmin-venv/bin/pip install Sphinx$SPHINX_VER || { echo 'ERROR: Failed to install Sphinx to build the tarballs.' ; exit 1; } -cd $WORKSPACE/ +${WORKSPACE}/pgadmin-venv/bin/pip install Sphinx${SPHINX_VER} || { echo 'ERROR: Failed to install Sphinx to build the tarballs.' ; exit 1; } +cd ${WORKSPACE}/ make src || { echo 'ERROR: Failed to build the tarballs.' ; exit 1; } \ No newline at end of file diff --git a/ci/ci_runner.sh b/ci/ci_runner.sh index 4b09167eb..51b3ac99a 100755 --- a/ci/ci_runner.sh +++ b/ci/ci_runner.sh @@ -1,11 +1,11 @@ #!/bin/sh -$WORKSPACE/ci/create_config.sh || { echo 'ERROR: Failed to create the configuration.' ; exit 1; } -$WORKSPACE/ci/run_python_tests.sh || { echo 'ERROR: Error detected when running the Python tests.' ; exit 1; } -$WORKSPACE/ci/run_jasmine_tests.sh || { echo 'ERROR: Error detected when running the Jasmine tests.' ; exit 1; } -$WORKSPACE/ci/build_docs.sh || { echo 'ERROR: Failed to build the documentation.' ; exit 1; } -$WORKSPACE/ci/build_runtime_qt4.sh || { echo 'ERROR: Failed to build the QT4 runtime.' ; exit 1; } -$WORKSPACE/ci/build_runtime_qt5.sh || { echo 'ERROR: Failed to build the QT5 runtime.' ; exit 1; } -$WORKSPACE/ci/update_messages.sh || { echo 'ERROR: Failed to update translation message catalogs.' ; exit 1; } -$WORKSPACE/ci/build_pip_wheel.sh || { echo 'ERROR: Failed to build the PIP wheel.' ; exit 1; } -$WORKSPACE/ci/build_tarballs.sh || { echo 'ERROR: Failed to build the tarballs.' ; exit 1; } +${WORKSPACE}/ci/create_config.sh || { echo 'ERROR: Failed to create the configuration.' ; exit 1; } +${WORKSPACE}/ci/run_python_tests.sh || { echo 'ERROR: Error detected when running the Python tests.' ; exit 1; } +${WORKSPACE}/ci/run_jasmine_tests.sh || { echo 'ERROR: Error detected when running the Jasmine tests.' ; exit 1; } +${WORKSPACE}/ci/build_docs.sh || { echo 'ERROR: Failed to build the documentation.' ; exit 1; } +${WORKSPACE}/ci/build_runtime_qt4.sh || { echo 'ERROR: Failed to build the QT4 runtime.' ; exit 1; } +${WORKSPACE}/ci/build_runtime_qt5.sh || { echo 'ERROR: Failed to build the QT5 runtime.' ; exit 1; } +${WORKSPACE}/ci/update_messages.sh || { echo 'ERROR: Failed to update translation message catalogs.' ; exit 1; } +${WORKSPACE}/ci/build_pip_wheel.sh || { echo 'ERROR: Failed to build the PIP wheel.' ; exit 1; } +${WORKSPACE}/ci/build_tarballs.sh || { echo 'ERROR: Failed to build the tarballs.' ; exit 1; } diff --git a/ci/create_config.sh b/ci/create_config.sh index ba2961e33..c964265f1 100755 --- a/ci/create_config.sh +++ b/ci/create_config.sh @@ -3,13 +3,13 @@ echo "EXECUTING: Create pgAdmin config" echo -cd $WORKSPACE +cd ${WORKSPACE} -cp $JENKINS_HOME/pgadmin-configs/config_local.py $WORKSPACE/web/config_local.py || { echo 'ERROR: Failed to create config_local.py.' ; exit 1; } -echo LOG_FILE = \"$WORKSPACE/var/pgadmin4.log\" >> $WORKSPACE/web/config_local.py || { echo 'ERROR: Failed to create config_local.py.' ; exit 1; } -echo SESSION_DB_PATH = \"$WORKSPACE/var/sessions\" >> $WORKSPACE/web/config_local.py || { echo 'ERROR: Failed to create config_local.py.' ; exit 1; } -echo STORAGE_DIR = \"$WORKSPACE/var/storage\" >> $WORKSPACE/web/config_local.py || { echo 'ERROR: Failed to create config_local.py.' ; exit 1; } -echo SQLITE_PATH = \"$WORKSPACE/var/pgadmin4.db\" >> $WORKSPACE/web/config_local.py || { echo 'ERROR: Failed to create config_local.py.' ; exit 1; } -echo TEST_SQLITE_PATH = \"$WORKSPACE/var/pgadmin4.db\" >> $WORKSPACE/web/config_local.py || { echo 'ERROR: Failed to create config_local.py.' ; exit 1; } +cp ${JENKINS_HOME}/pgadmin-configs/config_local.py ${WORKSPACE}/web/config_local.py || { echo 'ERROR: Failed to create config_local.py.' ; exit 1; } +echo LOG_FILE = \"${WORKSPACE}/var/pgadmin4.log\" >> ${WORKSPACE}/web/config_local.py || { echo 'ERROR: Failed to create config_local.py.' ; exit 1; } +echo SESSION_DB_PATH = \"${WORKSPACE}/var/sessions\" >> ${WORKSPACE}/web/config_local.py || { echo 'ERROR: Failed to create config_local.py.' ; exit 1; } +echo STORAGE_DIR = \"${WORKSPACE}/var/storage\" >> ${WORKSPACE}/web/config_local.py || { echo 'ERROR: Failed to create config_local.py.' ; exit 1; } +echo SQLITE_PATH = \"${WORKSPACE}/var/pgadmin4.db\" >> ${WORKSPACE}/web/config_local.py || { echo 'ERROR: Failed to create config_local.py.' ; exit 1; } +echo TEST_SQLITE_PATH = \"${WORKSPACE}/var/pgadmin4.db\" >> ${WORKSPACE}/web/config_local.py || { echo 'ERROR: Failed to create config_local.py.' ; exit 1; } -cp $JENKINS_HOME/pgadmin-configs/test_config.json $WORKSPACE/web/regression/test_config.json || { echo 'ERROR: Failed to copy the test configuration.' ; exit 1; } +cp ${JENKINS_HOME}/pgadmin-configs/test_config.json ${WORKSPACE}/web/regression/test_config.json || { echo 'ERROR: Failed to copy the test configuration.' ; exit 1; } diff --git a/ci/run_feature_tests.sh b/ci/run_feature_tests.sh index ae0a116bf..a5eb9b39e 100755 --- a/ci/run_feature_tests.sh +++ b/ci/run_feature_tests.sh @@ -13,25 +13,25 @@ export DISPLAY=:99 echo "Creating Python ${PYTHON_VERSION} virtual environment..." echo -cd $WORKSPACE/ +cd ${WORKSPACE}/ PYTHON_SUFFIX="" -if [[ "$PYTHON_VERSION" == 3* ]]; then +if [[ "${PYTHON_VERSION}" == 3* ]]; then PYTHON_SUFFIX="3" fi -if [ "$PYTHON_VERSION" == 2.6 -o "$PYTHON_VERSION" == 3.3 ]; then - /usr/bin/virtualenv --no-wheel -p /usr/local/python-$PYTHON_VERSION/bin/python$PYTHON_SUFFIX $WORKSPACE/pgadmin-venv || { echo 'ERROR: Failed to create the Python virtual environment.' ; exit 1; } - . $WORKSPACE/pgadmin-venv/bin/activate || { echo 'ERROR: Failed to activate the Python virtual environment.' ; exit 1; } - $WORKSPACE/pgadmin-venv/bin/pip install wheel==0.29.0 || { echo 'ERROR: Failed to install wheel 0.29.0.' ; exit 1; } +if [ "${PYTHON_VERSION}" == 2.6 -o "${PYTHON_VERSION}" == 3.3 ]; then + /usr/bin/virtualenv --no-wheel -p /usr/local/python-${PYTHON_VERSION}/bin/python${PYTHON_SUFFIX} ${WORKSPACE}/pgadmin-venv || { echo 'ERROR: Failed to create the Python virtual environment.' ; exit 1; } + . ${WORKSPACE}/pgadmin-venv/bin/activate || { echo 'ERROR: Failed to activate the Python virtual environment.' ; exit 1; } + ${WORKSPACE}/pgadmin-venv/bin/pip install wheel==0.29.0 || { echo 'ERROR: Failed to install wheel 0.29.0.' ; exit 1; } else - /usr/bin/virtualenv -p /usr/local/python-$PYTHON_VERSION/bin/python$PYTHON_SUFFIX $WORKSPACE/pgadmin-venv || { echo 'ERROR: Failed to create the Python virtual environment.' ; exit 1; } - . $WORKSPACE/pgadmin-venv/bin/activate || { echo 'ERROR: Failed to activate the Python virtual environment.' ; exit 1; } + /usr/bin/virtualenv -p /usr/local/python-${PYTHON_VERSION}/bin/python${PYTHON_SUFFIX} ${WORKSPACE}/pgadmin-venv || { echo 'ERROR: Failed to create the Python virtual environment.' ; exit 1; } + . ${WORKSPACE}/pgadmin-venv/bin/activate || { echo 'ERROR: Failed to activate the Python virtual environment.' ; exit 1; } fi -$WORKSPACE/pgadmin-venv/bin/pip install -r requirements.txt || { echo 'ERROR: Failed to install the application requirements.' ; exit 1; } -$WORKSPACE/pgadmin-venv/bin/pip install -r web/regression/requirements.txt || { echo 'ERROR: Failed to install the regression test requirements.' ; exit 1; } +${WORKSPACE}/pgadmin-venv/bin/pip install -r requirements.txt || { echo 'ERROR: Failed to install the application requirements.' ; exit 1; } +${WORKSPACE}/pgadmin-venv/bin/pip install -r web/regression/requirements.txt || { echo 'ERROR: Failed to install the regression test requirements.' ; exit 1; } cd web /usr/bin/yarn install || { echo 'ERROR: Failed to install the required Javascript modules.' ; exit 1; } @@ -41,9 +41,9 @@ cd ../ echo "Running regression tests..." echo -$WORKSPACE/pgadmin-venv/bin/python $WORKSPACE/web/regression/runtests.py --pkg feature_tests || { echo 'ERROR: Error detected when running the Feature tests.' ; exit 1; } +${WORKSPACE}/pgadmin-venv/bin/python ${WORKSPACE}/web/regression/runtests.py --pkg feature_tests || { echo 'ERROR: Error detected when running the Feature tests.' ; exit 1; } echo "Cleaning up..." echo -kill $FB_PID +kill ${FB_PID} diff --git a/ci/run_jasmine_tests.sh b/ci/run_jasmine_tests.sh index d2aa5a75f..b9de04959 100755 --- a/ci/run_jasmine_tests.sh +++ b/ci/run_jasmine_tests.sh @@ -3,7 +3,7 @@ echo "EXECUTING: Jasmine tests" echo -cd $WORKSPACE/web/ +cd ${WORKSPACE}/web/ /usr/bin/yarn install || { echo 'ERROR: Failed to install the required Javascript modules.' ; exit 1; } /usr/bin/yarn run linter || { echo 'ERROR: Failed to lint the Javascript code.' ; exit 1; } diff --git a/ci/run_python_tests.sh b/ci/run_python_tests.sh index 1d55935f8..f837397ac 100755 --- a/ci/run_python_tests.sh +++ b/ci/run_python_tests.sh @@ -6,25 +6,25 @@ echo echo "Creating Python ${PYTHON_VERSION} virtual environment..." echo -cd $WORKSPACE/ +cd ${WORKSPACE}/ PYTHON_SUFFIX="" -if [[ "$PYTHON_VERSION" == 3* ]]; then +if [[ "${PYTHON_VERSION}" == 3* ]]; then PYTHON_SUFFIX="3" fi -if [ "$PYTHON_VERSION" == 2.6 -o "$PYTHON_VERSION" == 3.3 ]; then - /usr/bin/virtualenv --no-wheel -p /usr/local/python-$PYTHON_VERSION/bin/python$PYTHON_SUFFIX $WORKSPACE/pgadmin-venv || { echo 'ERROR: Failed to create the Python virtual environment.' ; exit 1; } - . $WORKSPACE/pgadmin-venv/bin/activate || { echo 'ERROR: Failed to activate the Python virtual environment.' ; exit 1; } - $WORKSPACE/pgadmin-venv/bin/pip install wheel==0.29.0 || { echo 'ERROR: Failed to install wheel 0.29.0.' ; exit 1; } +if [ "${PYTHON_VERSION}" == 2.6 -o "${PYTHON_VERSION}" == 3.3 ]; then + /usr/bin/virtualenv --no-wheel -p /usr/local/python-${PYTHON_VERSION}/bin/python${PYTHON_SUFFIX} ${WORKSPACE}/pgadmin-venv || { echo 'ERROR: Failed to create the Python virtual environment.' ; exit 1; } + . ${WORKSPACE}/pgadmin-venv/bin/activate || { echo 'ERROR: Failed to activate the Python virtual environment.' ; exit 1; } + ${WORKSPACE}/pgadmin-venv/bin/pip install wheel==0.29.0 || { echo 'ERROR: Failed to install wheel 0.29.0.' ; exit 1; } else - /usr/bin/virtualenv -p /usr/local/python-$PYTHON_VERSION/bin/python$PYTHON_SUFFIX $WORKSPACE/pgadmin-venv || { echo 'ERROR: Failed to create the Python virtual environment.' ; exit 1; } - . $WORKSPACE/pgadmin-venv/bin/activate || { echo 'ERROR: Failed to activate the Python virtual environment.' ; exit 1; } + /usr/bin/virtualenv -p /usr/local/python-${PYTHON_VERSION}/bin/python${PYTHON_SUFFIX} ${WORKSPACE}/pgadmin-venv || { echo 'ERROR: Failed to create the Python virtual environment.' ; exit 1; } + . ${WORKSPACE}/pgadmin-venv/bin/activate || { echo 'ERROR: Failed to activate the Python virtual environment.' ; exit 1; } fi -$WORKSPACE/pgadmin-venv/bin/pip install -r requirements.txt || { echo 'ERROR: Failed to install the application requirements.' ; exit 1; } -$WORKSPACE/pgadmin-venv/bin/pip install -r web/regression/requirements.txt || { echo 'ERROR: Failed to install the regression test requirements.' ; exit 1; } +${WORKSPACE}/pgadmin-venv/bin/pip install -r requirements.txt || { echo 'ERROR: Failed to install the application requirements.' ; exit 1; } +${WORKSPACE}/pgadmin-venv/bin/pip install -r web/regression/requirements.txt || { echo 'ERROR: Failed to install the regression test requirements.' ; exit 1; } echo "Running PEP-8 checks..." echo @@ -34,5 +34,5 @@ make check-pep8 || { echo 'ERROR: Error detected when running the Python PEP-8 c echo "Running regression tests..." echo -$WORKSPACE/pgadmin-venv/bin/python $WORKSPACE/web/regression/runtests.py --exclude feature_tests || { echo 'ERROR: Error detected when running the Python tests.' ; exit 1; } +${WORKSPACE}/pgadmin-venv/bin/python ${WORKSPACE}/web/regression/runtests.py --exclude feature_tests || { echo 'ERROR: Error detected when running the Python tests.' ; exit 1; } diff --git a/ci/update_messages.sh b/ci/update_messages.sh index 1ea4c7f6a..751ec63b3 100755 --- a/ci/update_messages.sh +++ b/ci/update_messages.sh @@ -3,9 +3,9 @@ echo "EXECUTING: Compile messages" echo -cd $WORKSPACE/web +cd ${WORKSPACE}/web -. $WORKSPACE/pgadmin-venv/bin/activate || { echo 'ERROR: Failed to activate the Python virtual environment.' ; exit 1; } +. ${WORKSPACE}/pgadmin-venv/bin/activate || { echo 'ERROR: Failed to activate the Python virtual environment.' ; exit 1; } pybabel extract -F babel.cfg -o pgadmin/messages.pot pgadmin || { echo 'ERROR: Failed to extract messages from the source code.' ; exit 1; }