Skip to content

Commit

Permalink
Merge pull request #468 from totten/master-drush-backdrop
Browse files Browse the repository at this point in the history
civi-download-tools - Add drush-backdrop plugin
  • Loading branch information
totten authored Aug 21, 2019
2 parents 8da69e4 + 47901e9 commit e0ad228
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/config/backdrop-clean/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,11 @@ civicrm_install

pushd "$CMS_ROOT" >> /dev/null
php "$SITE_CONFIG_DIR/module-enable.php" civicrm

## Setup demo user
# drush -y en civicrm_webtest
drush -y user-create --password="$DEMO_PASS" --mail="$DEMO_EMAIL" "$DEMO_USER"
##FIXME drush -y user-add-role civicrm_webtest_user "$DEMO_USER"
#echo 'INSERT IGNORE INTO users_roles (uid,role) SELECT uid, "civicrm_webtest_user" FROM users WHERE name = @ENV[DEMO_USER];' \
# | env DEMO_USER="$DEMO_USER" amp sql -Ncms -e
popd >> /dev/null
7 changes: 7 additions & 0 deletions app/config/backdrop-demo/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,11 @@ civicrm_install
pushd "$CMS_ROOT" >> /dev/null
php "$SITE_CONFIG_DIR/module-enable.php" civicrm
civicrm_apply_demo_defaults

## Setup demo user
#drush -y en civicrm_webtest
drush -y user-create --password="$DEMO_PASS" --mail="$DEMO_EMAIL" "$DEMO_USER"
##FIXME: drush -y user-add-role civicrm_webtest_user "$DEMO_USER"
#echo 'INSERT IGNORE INTO users_roles (uid,role) SELECT uid, "civicrm_webtest_user" FROM users WHERE name = @ENV[DEMO_USER];' \
# | env DEMO_USER="$DEMO_USER" amp sql -Ncms -e
popd >> /dev/null
3 changes: 3 additions & 0 deletions app/config/backdrop-empty/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ backdrop_install
###############################################################################
## Extra configuration

pushd "$CMS_ROOT" >> /dev/null
drush -y user-create --password="$DEMO_PASS" --mail="$DEMO_EMAIL" "$DEMO_USER"
popd >> /dev/null
16 changes: 16 additions & 0 deletions bin/civi-download-tools
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ CIVISTRINGSURL="https://download.civicrm.org/civistrings/civistrings.phar-2018-0
JOOMLAURL="https://download.civicrm.org/joomlatools-console/joomla.phar-2017-06-19-62ff6a9df"
CODECEPTION_PHP5_URL="http://codeception.com/releases/2.3.6/php54/codecept.phar"
CODECEPTION_PHP7_URL="http://codeception.com/releases/2.3.6/codecept.phar"
DRUSH_BD_URL="https://github.com/backdrop-contrib/drush/archive/1.0.0.zip"
IS_QUIET=
IS_FORCE=
IS_FULL=
Expand Down Expand Up @@ -751,6 +752,21 @@ pushd $PRJDIR >> /dev/null
make_link "$PRJDIR/bin" "../extern/phpunit5/phpunit5.phar" "phpunit5"
make_link "$PRJDIR/bin" "../extern/phpunit6/phpunit6.phar" "phpunit6"

## Download "drush" addons
if [ -z "$IS_FORCE" -a -e "$PRJDIR/extern/drush-lib/backdrop" -a "$(cat $PRJDIR/extern/drush-lib-backdrop.txt)" == "$DRUSH_BD_URL" ]; then
echo_comment "[[drush-backdrop ($PRJDIR/extern/drush-lib/backdrop) already exists. Skipping.]]"
else
download_url "$DRUSH_BD_URL" "$TMPDIR/drush-backdrop.zip"
[ -d "$PRJDIR/extern/drush-lib/backdrop" ] && rm -rf "$PRJDIR/extern/drush-lib/backdrop"
mkdir -p "$PRJDIR/extern/drush-lib/backdrop"
pushd "$PRJDIR/extern/drush-lib/backdrop" >> /dev/null
# touch created-by-me
unzip "$TMPDIR/drush-backdrop.zip"
popd >> /dev/null
rm -f "$TMPDIR/drush-backdrop.zip"
echo "$DRUSH_BD_URL" > "$PRJDIR/extern/drush-lib-backdrop.txt"
fi

## Download "hub"
touch "$PRJDIR/extern/hub.txt"
if [ -z "$IS_FORCE" -a -e "$PRJDIR/extern/hub/bin/hub" -a -e "$PRJDIR/bin/hub" -a "$(cat $PRJDIR/extern/hub.txt)" == "$HUB_VERSION" ]; then
Expand Down
2 changes: 1 addition & 1 deletion src/drush/drush8.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ if [ "$PWD" == "$BINDIR" ]; then
echo "Error: Cannot run drush from the bin dir. Please navigate to a site dir." >&2
exit 1
fi
exec "$PRJDIR/extern/drush8.phar" "$@"
exec "$PRJDIR/extern/drush8.phar" --include="$PRJDIR/extern/drush-lib" "$@"

0 comments on commit e0ad228

Please sign in to comment.