lando / symfony

The Official Symfony Lando Plugin
https://docs.lando.dev/symfony/
GNU General Public License v3.0
6 stars 2 forks source link

`lando symfony` command result in an error #16

Open flovntp opened 1 year ago

flovntp commented 1 year ago

Hi Lando Team, I'm using latest 3.9.0 version and in the list of available commands, one is about symfony. I know that for running Symfony commands within the app container, we need to use lando console but still, why is it listed as a valid command but raising a not found error ?

platformsh-symfony-template % lando         
Usage: lando <command> [args] [options]

Commands:
... 
  lando symfony           Runs symfony commands
... 
platformsh-symfony-template % lando version 
v3.9.0
platformsh-symfony-template % lando symfony 
/bin/sh: 1: symfony: not found
platformsh-symfony-template % 

BTW, I'm trying to add a README file with Lando instructions (local development) to use our Platform.sh Symfony template locally... and BTW, great job, Lando is working well.

jibla commented 1 year ago

I also faced the same issue.

After you just create .lando.yml file with symfony recipe and run lando start, you can't run landy symfony simply because Symfony CLI is not installed inside the container, even though it is listed as a tooling command.

As a workaround, you can install symfony manyally in the container with the following commands:

# first ssh into the container as a root
lando ssh --service appserver --user root
# then install the symfony cli according to their installation guide
curl -1sLf 'https://dl.cloudsmith.io/public/symfony/stable/setup.deb.sh' | bash
apt install symfony-cli

After this, if you log out from the container and run lando symfony it should work.

Generally, I think the proper solution to this issue is that, recipe should install symfony cli in the container somehow (I am not aware of the internals of lando library and don't know how to achieve that exactly).

jibla commented 1 year ago

The better way is to put these commands in build_as_root to run on every rebuild.

Like this:

services:
  appserver:
    build_as_root:
      - curl -1sLf 'https://dl.cloudsmith.io/public/symfony/stable/setup.deb.sh' | bash
      - apt install symfony-cli