Created
June 21, 2019 21:18
-
-
Save sean-e-dietrich/c4f4499b098366b1292ab0628bd2d46f to your computer and use it in GitHub Desktop.
Contrib Command For Docksal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
- I found that I needed to make the file executable first.
chmod 755 contrib
on a mac. - 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
To use place the following file in
~/.docksal/commands/contrib
and runfin contrib
or you can runfin contrib new-test