magento-lts icon indicating copy to clipboard operation
magento-lts copied to clipboard

docs: added ddev snippets

Open sreichel opened this issue 3 years ago • 6 comments

Description (*)

I'v seen @ADDISON74 plays around with DDEV ... just want to share this.

Contribution checklist (*)

  • [x] Pull request has a meaningful description of its purpose
  • [x] All commits are accompanied by meaningful commit messages
  • [x] All automated tests passed successfully (all builds are green)
  • [x] Add yourself to contributors list

sreichel avatar Sep 08 '22 00:09 sreichel

DDEV is the reason why I can now work in Windows, without having to install or clone VMs as I used to do before. I have everything on a stick. I will continue to keep the VMs for testing before production. As I said in another post, quoting from an IT article, Docker was called one of the wonderful things still happening in the world of programming.

The fact that DDEV facilitates the testing of several frameworks is an enormous relief of the work to set up a test environment. In addition, it has a huge number of features, for example I like that I can change the PHP version just by editing the file without having to deal with the installation of those packages. I can choose between Nginx or Apache and many others. testing becomes much faster and I can evaluate different configurations. I've only been working with it for 2 weeks and I'm not even sorry that I spent time learning it part from the surface.

addison74 avatar Sep 08 '22 09:09 addison74

You can mention a few lines about using Magento 1 Sample Data.

## Use Magento 1 Sample Data

Get in your working directory the Magento 1 Sample Data package from here https://pubfiles.nexcess.net/magento/sample-data/magento-sample-data-1.9.1.0.tar.gz then extract the files using the tar command.

Import to database the dump file "magento_sample_data_for_1.9.1.0.sql" with ddev import-db --src=magento_sample_data_for_1.9.1.0.sql before running OpenMage installation.

Please note that OpenMage is a huge codebase and using mutagen_enabled: true is recommended for performance on macOS and traditional Windows.

I did not mention the link to Vinai's repository like in the DDEV source because it is only 80 MB, while the original from Nexcess is 415 MB.

addison74 avatar Sep 08 '22 09:09 addison74

I'd use @Vinai repo. It's complete and just uses better compressed images.

sreichel avatar Sep 08 '22 21:09 sreichel

You can change the link to Vinai's repository (as DDEV also recommends) based on your arguments.: https://raw.githubusercontent.com/Vinai/compressed-magento-sample-data/1.9.1.0/compressed-magento-sample-data-1.9.1.0.tgz

Please check my inline comments. You can add this tip:

## Enable Developer Mode
Edit .ddev/config.yaml file and add the following lines:

web_environment: 
    MAGE_IS_DEVELOPER_MODE=1

addison74 avatar Sep 08 '22 22:09 addison74

You can change the link to Vinai's repository (as DDEV also recommends) based on your arguments.: https://raw.githubusercontent.com/Vinai/compressed-magento-sample-data/1.9.1.0/compressed-magento-sample-data-1.9.1.0.tgz

This link is outdated ... opened PR at ddev to use latest versions.

sreichel avatar Sep 09 '22 00:09 sreichel

Thanks to @kkrieger85 for issues/PRs at DDEV :+1:

sreichel avatar Sep 09 '22 15:09 sreichel

@sreichel - I created a few comments in the code days ago. Please let me know your opinion.

addison74 avatar Oct 02 '22 21:10 addison74

@ADDISON74 Have i missed something? I've added dev-mode, but did not add sample-data, b/c its mentioned at ddev-docs.

edit: you can also edit/update this PR :)

sreichel avatar Oct 02 '22 21:10 sreichel

I will revise it these days and add what is missing, but not before letting you know.

addison74 avatar Oct 03 '22 13:10 addison74

I would also recommend this addon https://github.com/drud/ddev-browsersync. There is an open PR for dealing with HTTPS connections. A feature which was missing and which is extremely important if mkcert is used (DDEV detects automatically the SSL files).

addison74 avatar Oct 04 '22 15:10 addison74

In the case of the dev script created by @colinmollenhour located in /dev directory, he provided that the Backend needs a user. If a database is imported through the command ddev import-db --src=file_name.sql, it most likely has an administrator account and it is no longer necessary to create it.

Please note DDEV is not creating a user for Backend for a git clone OM.

The issue is that by running the ddev config command the /etc/local.xml file will be created, which means the OM instance doesn't need installation, but it will not have an account to access the Backend. In this case there are two options:

  1. Run ddev describe to get information about accessing phpMyadmin. Once you access the interface select the db database and run the SQL query from bellow (it creates a username: admin with password: admin):
INSERT INTO `admin_user` (`user_id`, `firstname`, `lastname`, `email`, `username`, `password`, `created`, `modified`, `logdate`, `lognum`, `reload_acl_flag`, `is_active`, `extra`, `rp_token`, `rp_token_created_at`) VALUES
(1, 'Open', 'Mage', '[email protected]', 'admin', '17ef9b5a13acc91cc8f7bfe49a90e01f1e04ad6c885616a07d2ad7229617992c:MKZ25yJs32F11JWKvbVbDqebeB35NV4n', '2022-10-04 16:26:46', '2022-10-04 17:16:57', '2022-10-04 17:16:57', 0, 0, 1, 'N;', NULL, NULL);
  1. Rename the /etc/local.xml file to initiate the installation from scratch. It can be done in browser (Host: db, Database Name: db, User Name: db, User Password: db) or in CLI.

I hope that those who want to try DDEV will not encounter any issue that will cause them to abandon evaluating this quick possibility to create a test environment based on Docker. After testing last night in a VM with Ubuntu 22.04 (Docker + DDEV + Phpstorm) I was left with a pleasant impression regarding the consumption of resources and especially the speed of the work environment.

addison74 avatar Oct 04 '22 17:10 addison74

I reported the above issue here https://github.com/drud/ddev/issues/4259 but it seems that we will have to find a solution to it.

addison74 avatar Oct 05 '22 17:10 addison74

I will complete this README with several solutions in different situations. For example, how to import a database and files, how to take a snapshot, how to use Composer and many others.

Also, a link must be added in the README file of OpenMage located in the root to this file. DDEV must be promoted because it represents a much better and more flexible solution in Windows than XAMPP/WAMPP, being preferable to a VM provided that you are familiar with Docker at an average level.

addison74 avatar Oct 18 '22 08:10 addison74