Skip to content
Permalink
Browse files

Don't use imple variable notation in bash scripts.

  • Loading branch information...
dpage committed Jun 25, 2018
1 parent 5bdd80e commit 27bb7ff5db2be892c9a7aa8880a01a907572a7e1
@@ -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; }
@@ -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; }
@@ -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; }
@@ -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; }
@@ -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; }
@@ -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; }
@@ -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; }
@@ -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}
@@ -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; }
@@ -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; }

@@ -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; }

0 comments on commit 27bb7ff

Please sign in to comment.
You can’t perform that action at this time.