lando / drupal

The Official Drupal Lando plugin
https://docs.lando.dev/drupal
GNU General Public License v3.0
16 stars 16 forks source link

Updated installation of Drupal 9/10 via Composer #33

Closed HarishSTOnline closed 2 years ago

HarishSTOnline commented 2 years ago

The current doc rely on installing Drupal via zip file. But the recommended method is via Composer. This commit updates the docs to use composer for installing Drupal.

netlify[bot] commented 2 years ago

Deploy Preview for lando-drupal ready!

Name Link
Latest commit 4313492087b6d8fc095bcc5a3b8f4be8f2977fdb
Latest deploy log https://app.netlify.com/sites/lando-drupal/deploys/630356db249e100008930a1b
Deploy Preview https://deploy-preview-33--lando-drupal.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

reynoldsalec commented 2 years ago

Thanks @HarishSTOnline!

gitressa commented 2 years ago

While I agree that this would be great in theory, it probably needs to be rolled back, because it doesn't really work.

You need to run lando start before running lando composer, but that will give you ninety seconds of Scanning to determine which services are ready... Please stand by... ending with lots of red URLs, since there is nothing in the folder.

Lando first needs to solve the chicken-and-egg Composer challenge for this method to work. For more, see https://github.com/lando/lando/issues/2405#issuecomment-660505327 and DDEV which supports Composer-based download of files.

$ time lando start
Let's get this party started! Starting app my-first-drupal10-app...
landoproxyhyperion5000gandalfedition_proxy_1 is up-to-date
Creating network "myfirstdrupal10app_default" with the default driver
Creating volume "myfirstdrupal10app_data_appserver" with default driver
Creating volume "myfirstdrupal10app_home_appserver" with default driver
Creating volume "myfirstdrupal10app_data_database" with default driver
Creating volume "myfirstdrupal10app_home_database" with default driver
Creating myfirstdrupal10app_appserver_1 ... done
usermod: no changes
usermod: no changes
All settings correct for using Composer
Downloading...

Composer (version 2.2.12) successfully installed to: /usr/local/bin/composer
Use it: php /usr/local/bin/composer

Killing myfirstdrupal10app_appserver_1 ... 
Killing myfirstdrupal10app_appserver_1 ... done
Starting myfirstdrupal10app_appserver_1 ... done
Creating myfirstdrupal10app_database_1  ... done
Waiting until database service is ready...
Waiting until database service is ready...
Waiting until database service is ready...
Scanning to determine which services are ready... Please stand by...

   ___                      __        __        __     __        ______
  / _ )___  ___  __ _  ___ / /  ___ _/ /_____ _/ /__ _/ /_____ _/ / / /
 / _  / _ \/ _ \/  ' \(_-</ _ \/ _ `/  '_/ _ `/ / _ `/  '_/ _ `/_/_/_/ 
/____/\___/\___/_/_/_/___/_//_/\_,_/_/\_\\_,_/_/\_,_/_/\_\\_,_(_|_|_)  

Your app has started up correctly.
Here are some vitals:

 NAME            my-first-drupal10-app                    
 LOCATION        /home/user/dev/my-first-drupal10-app      
 SERVICES        appserver, database                      
 APPSERVER URLS  https://localhost:49174                  
                 http://localhost:49175                   
                 http://my-first-drupal10-app.lndo.site/  
                 https://my-first-drupal10-app.lndo.site/ 

real    1m26,367s
user    0m8,590s
sys 0m1,610s
HarishSTOnline commented 2 years ago

@gitressa I am not sure if you misunderstood this. I understand composer create-project doesn't work on non-empty directory. But this update doesn't need you to start lando (lando start) before running composer create-project command.

We are basically creating the project with composer in a temp directory and then moving the application code back into root directory. Please confirm if the code is moved to root directory before going forward with lando start. Checkout the Symfony recipe for a similar approach being documented.

Meanwhile, let me try creating a project again and update the findings.

gitressa commented 2 years ago

I am sorry HarishSTOnline, you are correct.

I might have had an old my-first-drupal10-app Docker instance, which was being resurrected, causing errors when I ran lando composer.

After starting fresh and removing the lingering docker instance, your update works perfectly, so thanks for updating the documentation, I really appreciate it.

HarishSTOnline commented 2 years ago

Thanks buddy for the quick update! Happy that it helps!

gitressa commented 2 years ago

Great! Maybe you have seen it already @HarishSTOnline, but there is also Lando + Drupal Contributions where a few simple Pull requests, for example to update Drupal version, are ready for review. Also, the documentation can always be improved or updated, so feel free to check it out.

HarishSTOnline commented 2 years ago

Sure, I'll check that out when I get some free time! Thanks!

HarishSTOnline commented 2 years ago

I've added an approval review for one of the pull request. It needs a approving review from maintainers though.

gitressa commented 2 years ago

Thanks, have a great weekend!