Skip to content

Instantly share code, notes, and snippets.

@sean-e-dietrich
Created June 21, 2019 21:18
Show Gist options
  • Save sean-e-dietrich/c4f4499b098366b1292ab0628bd2d46f to your computer and use it in GitHub Desktop.
Save sean-e-dietrich/c4f4499b098366b1292ab0628bd2d46f to your computer and use it in GitHub Desktop.
Contrib Command For Docksal
#!/bin/bash
NAME=$1
VERSION=${2:-8.8.x}
if [[ -z "${NAME}" ]]; then
NAME=$(uuidgen)
fi
if [[ -d $NAME ]]; then
echo "$NAME already exists. Exiting..."
exit 1
fi
echo "Cloning Drupal Git Repo..."
git clone --branch $VERSION https://git.drupalcode.org/project/drupal.git $NAME
cd $NAME
echo "Generating Docksal Config..."
fin config generate --docroot=.
echo "Starting Docksal..."
fin start
echo "Running Composer install..."
fin composer install
# D8 Install
fin drush --yes si \
--account-mail="[email protected]" \
--account-name="admin" \
--account-pass="admin" \
--db-url=mysql://root:root@db/default \
standard \
install_configure_form.enable_update_status_emails=NULL \
install_configure_form.enable_update_status_module=NULL
echo "Drupal has been installed with default username and password (admin/admin)"
echo "Generating a One Time Login Link..."
fin drush uli
@sean-e-dietrich
Copy link
Author

To use place the following file in ~/.docksal/commands/contrib and run fin contrib or you can run fin contrib new-test

@thejimbirch
Copy link

thejimbirch commented Apr 13, 2020

  1. I found that I needed to make the file executable first. chmod 755 contrib on a mac.
  2. I also needed to reset Docksal fin system reset

If you add the following to the script at line 3 and they will show up in fin help:

## Set up a Drupal site for contrib work. Usage: fin contrib SITENAME

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment