-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Hi folks
I'd like to gather some views on a problem. Presently the first step in our local development set up is:
composer create-project --stability dev localgovdrupal/localgov-project MY_PROJECT --remove-vcs
While this is a low-friction way to get started it does have the following problems:
- The user will need to have Composer installed on their machine, presumably version 2
- The user will need to have PHP installed on their machine and it should meet the version required by the version of Drupal core we're using
- Any PHP extensions required by LocalGov Drupal or any of it's dependencies will also need to be installed
The major advantage of using Lando is we only require users\developers to have Lando\Docker installed furthermore if the user composer installs on a different version of PHP to what's being used in Lando this has the potential to cause compatibility problems.
There is an issue on Lando's Github which relevant; as you can see there is presently no feature in Lando to address this though it does sound like this is something DDev has solved there's potential for this feature to be added to Lando.
In the meantime I believe we have some options to workaround this and give a better DX to boot. For example, we could have a one-liner such as:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/localgovdrupal/localgov_project/master/tools/install.sh)"
With install.sh looking something like:
#!/bin/bash
read -p 'directory name: ' DIRNAME
TARURL=$( curl -s https://api.github.com/repos/localgovdrupal/localgov_project/releases/latest | grep -o -P 'https://api.github.com/repos/localgovdrupal/localgov_project/tarball/\d\.\d\.\d')
echo "Downloading project template..."
echo $TARURL
curl $TARURL -L -o template.tar.gz
echo "Extracting project template..."
tar -xf template.tar.gz
echo "Removing archive..."
rm template.tar.gz
TARDIR=$(ls -l | grep -o 'localgovdrupal-localgov_project-.*')
mv $TARDIR $DIRNAME
echo "Starting Lando and installing LocalGov Drupal..."
cd $DIRNAME && lando start
lando composer install
lando drush si localgov -y
lando drush uli
echo "Congratulations! You have installed LocalGov Drupal"
Though I'm sure there's other, and better, ways we could do this hence this issue.
Admittedly, this isn't a problem which is relatively high priority at the moment but as the PHP version required by Drupal core rolls on and the LGD user base grows it has the potential to be a sticking point.