akeneo / pim-community-dev

[Community Development Repository] The open source Product Information Management (PIM)
http://www.akeneo.com
Other
954 stars 516 forks source link

Code distributed with a parameters.yml #6277

Closed QwertyZW closed 7 years ago

QwertyZW commented 7 years ago

I'm reporting a problem with distribution

It seems that both https://download.akeneo.com/pim-community-standard-v1.7-latest-icecat.tar.gz https://download.akeneo.com/pim-community-standard-v1.7-latest.tar.gz are distributed with a parameters.yml.

My current understanding is that this file is meant to be generated by the composer install command. If the file is distributed with the source, like it already is, composer install will skip asking the user for the database configuration all together. This leads to confusion as seen here, and here.

iulyanp commented 7 years ago

Hi @QwertyZW

Those .tar archives contain the full application already installed, as if you cloned the PIM CE from Github and run composer install on it, that's why the parameters.yml file is already generated.

QwertyZW commented 7 years ago

I'm confused even further now...why do the instructions say that composer install and pim:install need to be ran if the application is already installed? Also how is the application installed without a preconfigured database?

iulyanp commented 7 years ago

Hello @QwertyZW

Sorry for the confusion. If you're looking on this https://docs.akeneo.com/1.7/developer_guide/installation/installation_archive.html page, from what I see composer install is optional for community edition. If you're installing akeneo from the archive, all you have to do is configure the database connection into the paramteres.yml and parameters.yml.dist and run:

$ php app/console cache:clear --env=prod
$ php app/console pim:install --env=prod

You should have PIM working if your web server was configured correctly.

Another way would be to extract the archive, delete the parameters.yml, configure the database connection into parameters.yml.dist and run:

$ ../composer.phar install --optimize-autoloader --prefer-dist
$ php app/console cache:clear --env=prod
$ php app/console pim:install --env=prod

The composer.phar install command will check the vendors to be installed and also will auto generate the parameters.yml file because of this line from the composer.json:

    ...
    "scripts": {
        "post-install-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
    ...

If you want to read more about parameters.yml best practice check this https://symfony.com/blog/new-in-symfony-2-3-interactive-management-of-the-parameters-yml-file and http://symfony.com/doc/3.0/best_practices/configuration.html#canonical-parameters.

Make sure you add /app/config/parameters.yml to .gitignore file so that will not be versioned.

Cheers,

QwertyZW commented 7 years ago

I see, so what you mean by

Those .tar archives contain the full application already installed

(I might still be wrong) is having the dependencies preinstalled in vendor/, not necessarily having a preconfigured database, but maybe having a preconfigured database configuration (a pre-existing parameters.yml)

The composer install command,whether it's a case of a preinstalled application or not, is capable of generating parameters.yml. If that isn't delegated to php app/console pim:install --env=prod as proposed here https://github.com/akeneo/pim-community-dev/issues/6221 it might be worthwhile to have it generate the database configuration all the time, as proposed by this issue. This might mitigate some of the confusion, at least until the documentation is updated.

Regards

iulyanp commented 7 years ago

What I was trying to say is that in the archives you have the application already configured with the basic development parameters and with all the vendors already installed for you.

If you have the mysql server installed on your local machine all you have to do is create the database akeneo_pim and the db user akeneo_pim as it is specified here https://docs.akeneo.com/1.7/developer_guide/installation/system_requirements/system_install_ubuntu_1404.html#mysql, then run the first 2 commands from my previous comment and you're done.

Regards

momoss commented 7 years ago

Hi @QwertyZW

Did you find answers to your questions? If so, can we close this issue?

Thanks!