When testing issues related to installation and uninstallation of DXPR Builder or our demo sites we should use a fast installation workflow that takes advantage of Drupal' and Drush' built in database system and server.

The workflow is different for our 7.x and 1.x products, please keep that in mind when using the below information.

Set-up

Drupal's quick-start is well documented here, please follow the instructions and verify you can launch a Drupal installation using "quick-start": https://www.drupal.org/docs/installing-drupal/drupal-quick-start-command

DXPR Builder installation, uninstallation, and re-installation

Terminal commands:

mkdir drupal && cd drupal && curl -sSL https://www.drupal.org/download-latest/tar.gz | tar -xz --strip-components=1
php ./core/scripts/drupal quick-start --no-interaction --suppress-login minimal &
sleep 5
cd modules

You may need to fine tune the command "sleep 5" to reflect the number of seconds it takes your machine to run the preceding installation command.

Here is a video showing the above commands functioning correctly:

 

1. Check your Drush version

In my experience the instructions in paragraph #2 did not work with the latest Drush stable release, therefore we will install the latest Drush 8.x development code using a composer workflow. If you type "drush --version" and the output is something like "8...-dev" skip to paraphgraph #2 of this tutorial. If the string does not and with -dev please follow the next steps:

 

  1. Open a terminal window
  2. Type which drush. If the output does not contain ".composer" in the path please delete the drush installation that you currently have. We're going to re-install Drush using composer.
  3. Now we're going to install a "composer global" tools that fixes some issues that composer's native global installation feature has. Type in hte following command: composer global require consolidation/cgr.
  4. Make sure your Drush is uninstalled cleanly by confirming that "which drush" returns an empty string
  5. Install Drush-dev with cgr: cgr drush/drush:8.x-dev
  6. Now you have to add the composer bin directory to your $PATH. Type "echo $PATH | grep .composer", if it returns any text the composer directory is already in your $PATH, you can skip to step 8. If it returns an empty string go to step 7.
  7. On Linux: enter command: echo 'export PATH="$(composer config -g home)/vendor/bin:$PATH"' >> ~/.bashrc
    On MacOS: enter command echo 'export PATH="$(composer config -g home)/vendor/bin:$PATH"' >> ~/.bash_profile
  8. Confirm that the 8.x development version of Drush is installed by typing drush --version and checking that the returned string ends in -dev

Troubleshooting

If you run into any problems with the above commands please check the sources on which I based this tutorial:
https://docs.drush.org/en/8.x/install-alternative/
https://github.com/consolidation/cgr#installation-and-usage

 

2. Launch a quick installation with Drush qd

  1. (optional) Make sure that port 8888 is free with the following command: sudo lsof -t -i tcp:8888 | xargs kill -9
  2. Launch a fresh Drupal 7 site with with following command: drush qd --core=drupal-7 -y
  3. This should install Drupal 7 and launch a browser window that logs you in as admin
  4. Go back to the terminal and open a new terminal tab with ctrl-t
  5. in the terminal tab cd into your new quickdrupal folder
  6. Navigate to drupal-7 with cd drupal-7
  7. From here you can manipulate the Drupal 7 site by installing modules, themes, etc.

 

3. Example command sequence to test installation and uninstallation of DXPR Builder 7.x

 

sudo lsof -t -i tcp:8888 | xargs kill -9
drush qd --core=drupal-7 -y

open new terminal tab and cd into last-modified directory

cd  "$(\ls -1dt ./*/ | head -n 1)"
cd drupal-7
cd sites/all/modules