Hashar has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/367893 )

Change subject: Fix misc bash oddities in the CI scripts
......................................................................

Fix misc bash oddities in the CI scripts

I have passed "shellcheck -x" and addressed all the tiny issues in the
CI shell scripts.  That makes them slightly more robust.

Change-Id: I0bc1627752533f58bf4fa69cefbf99a68ebd0638
---
M bin/ci-create-dbs.sh
M bin/ci-drop-dbs.sh
M bin/ci-populate-dbs.sh
M bin/drupal-install.sh
4 files changed, 14 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/93/367893/1

diff --git a/bin/ci-create-dbs.sh b/bin/ci-create-dbs.sh
index 1ed07ca..bac6a3c 100755
--- a/bin/ci-create-dbs.sh
+++ b/bin/ci-create-dbs.sh
@@ -1,6 +1,7 @@
 #!/bin/bash -eu
 
-BASEDIR=$(dirname $0)
+BASEDIR=$(dirname "$0")
+# shellcheck source=ci-settings.sh
 . $BASEDIR/ci-settings.sh
 
 echo "Creating databases with the prefix '${CIVICRM_SCHEMA_PREFIX}'"
diff --git a/bin/ci-drop-dbs.sh b/bin/ci-drop-dbs.sh
index 4925a9c..b5cfb1a 100755
--- a/bin/ci-drop-dbs.sh
+++ b/bin/ci-drop-dbs.sh
@@ -1,6 +1,7 @@
 #!/bin/bash -eu
 
-BASEDIR=$(dirname $0)
+BASEDIR=$(dirname "$0")
+# shellcheck source=ci-settings.sh
 . $BASEDIR/ci-settings.sh
 
 echo "Dropping databases with the prefix '${CIVICRM_SCHEMA_PREFIX}'"
diff --git a/bin/ci-populate-dbs.sh b/bin/ci-populate-dbs.sh
index ea31286..e8ab288 100755
--- a/bin/ci-populate-dbs.sh
+++ b/bin/ci-populate-dbs.sh
@@ -1,6 +1,7 @@
 #!/bin/bash -eu
 
-BASEDIR=$(dirname $0)
+BASEDIR=$(dirname "$0")
+# shellcheck source=ci-settings.sh
 . $BASEDIR/ci-settings.sh
 
 echo "Populating databases with the prefix '${CIVICRM_SCHEMA_PREFIX}'"
@@ -11,15 +12,15 @@
 
 #FIXME: --web-root="$WORKSPACE/src/crm"
 
-$WORKSPACE/src/wikimedia/fundraising/civicrm-buildkit/bin/civi-download-tools
+"$WORKSPACE"/src/wikimedia/fundraising/civicrm-buildkit/bin/civi-download-tools
 
-$WORKSPACE/src/wikimedia/fundraising/civicrm-buildkit/bin/amp config:set \
+"$WORKSPACE"/src/wikimedia/fundraising/civicrm-buildkit/bin/amp config:set \
        --db_type=mysql_precreated \
        --httpd_type=none \
        --perm_type=none
 
-rm -rf $WORKSPACE/src/wikimedia/fundraising/civicrm-buildkit/build/wmff
-mkdir -p $WORKSPACE/src/wikimedia/fundraising/civicrm-buildkit/build
-ln -s $WORKSPACE/src/wikimedia/fundraising/crm 
$WORKSPACE/src/wikimedia/fundraising/civicrm-buildkit/build/wmff
+rm -rf "$WORKSPACE"/src/wikimedia/fundraising/civicrm-buildkit/build/wmff
+mkdir -p "$WORKSPACE"/src/wikimedia/fundraising/civicrm-buildkit/build
+ln -s "$WORKSPACE"/src/wikimedia/fundraising/crm 
"$WORKSPACE"/src/wikimedia/fundraising/civicrm-buildkit/build/wmff
 
-$WORKSPACE/src/wikimedia/fundraising/civicrm-buildkit/bin/civibuild reinstall 
wmff
+"$WORKSPACE"/src/wikimedia/fundraising/civicrm-buildkit/bin/civibuild 
reinstall wmff
diff --git a/bin/drupal-install.sh b/bin/drupal-install.sh
index ea4ff27..9183b58 100755
--- a/bin/drupal-install.sh
+++ b/bin/drupal-install.sh
@@ -1,7 +1,7 @@
 #!/bin/bash -eu
 
 if [ $# -ne 3 ]; then
-       app_name=`basename $0`
+       app_name=$(basename "$0")
        cat <<-EOS
                Usage: $app_name DB_URL SITE_NAME ADMIN_PASSWORD
 
@@ -16,7 +16,7 @@
 ADMIN_PASSWORD=$3
 
 drush \
-       --root=`dirname $0`/../drupal \
+       --root="$(dirname "$0")"/../drupal \
     site-install standard \
     --db-url="$DB_URL" \
     --site-name="$SITE_NAME" \

-- 
To view, visit https://gerrit.wikimedia.org/r/367893
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0bc1627752533f58bf4fa69cefbf99a68ebd0638
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to