BlackbitDigitalCommerce / pimcore-data-director

Import Bundle for Pimcore
16 stars 3 forks source link

NFR: local source path configuration for data-director:deployment:dataport-rebuild #35

Closed kaurov closed 2 years ago

kaurov commented 2 years ago

https://www.youtube.com/watch?v=B4GqswnTYtU&t=1924s you set the local path in ''XML resource file' like /var/www/html... But that path is usually different on localhost, staging, and production. What is the best practice to have the configuration in the repository and to have those paths different? symlinks?

Can you please provide

BlackbitDevs commented 2 years ago

You can provide a relative path (relative to Pimcore root directory), e.g. import/ refers to <Pimcore root directory>/import/ Everything what looks like a path but does not have a leading slash gets interpreted as a relative path to the Pimcore root (except URLs, FTP, Curl calls etc.) If even this is not enough because you want to put the import files to completely different directories, you can use environment variables, e.g. when you have {{ import_folder|default("import/") }} as import resource, this tries to find an environment variable named import_folder. If this does not exist, it falls back to import/ (this is Twig syntax).

kaurov commented 2 years ago

Thanks.

som/local/path really works fine on 'Attribute mapping' and 'History & Run import' Tabs but it does not work for data preview on 'Settings' Tab.

BlackbitDevs commented 2 years ago

? You mean that you do not see the Example data on the settings tab when using a relative path? Or what does not work on the Settings tab?

kaurov commented 2 years ago

Exactly

BlackbitDevs commented 2 years ago

Is fixed in 3.2. The reason why it worked on attribute mapping panel / raw data extraction is that those execute the dd:extract command in a separate process with <Pimcore root folder> as working directory. The Example data in the settings tab tried to load the data in a normal HTTP request without executing a CLI command. But as Pimcore's default working directory is <Pimcore root folder>/public, it did not find your file in the root folder.