Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: added ddev snippets #2575

Merged
merged 2 commits into from
Oct 3, 2022
Merged

docs: added ddev snippets #2575

merged 2 commits into from
Oct 3, 2022

Conversation

sreichel
Copy link
Contributor

@sreichel sreichel commented Sep 8, 2022

Description (*)

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

Contribution checklist (*)

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

fballiano
fballiano previously approved these changes Sep 8, 2022
@addison74
Copy link
Contributor

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
Copy link
Contributor

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.

@sreichel
Copy link
Contributor Author

sreichel commented Sep 8, 2022

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

@addison74
Copy link
Contributor

addison74 commented Sep 8, 2022

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

@sreichel
Copy link
Contributor Author

sreichel commented Sep 9, 2022

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
Copy link
Contributor Author

sreichel commented Sep 9, 2022

Thanks to @kkrieger85 for issues/PRs at DDEV 👍

@addison74
Copy link
Contributor

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

@sreichel
Copy link
Contributor Author

sreichel commented Oct 2, 2022

@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 :)

@addison74
Copy link
Contributor

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

@fballiano fballiano merged commit c49452b into OpenMage:1.9.4.x Oct 3, 2022
@sreichel sreichel deleted the ddev-docs branch October 3, 2022 19:44
@@ -0,0 +1,69 @@
# OpenMage DDEV environment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would put this link on the next line
https://ddev.readthedocs.io/en/stable/

## Use xDebug with PhpStorm

If xdebug works not correctly with phpstorm.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If xDebug doesn't work properly in PhpStorm.

DDEV changes port numbers on every restart.

If you use PhpStorms DB feature, it is helpful to use fixed port numbers. E.g.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you access the database in PhpStorm set up a fixed port number.

(without E.g.)

@addison74
Copy link
Contributor

addison74 commented Oct 4, 2022

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
Copy link
Contributor

addison74 commented Oct 4, 2022

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', 'contact@ddev.site', '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
Copy link
Contributor

I reported the above issue here ddev/ddev#4259 but it seems that we will have to find a solution to it.

sreichel added a commit that referenced this pull request Oct 17, 2022
* Fixed "should return string but returns false"

* Fixed "should return XYZ but returns false"

* Fixed "should return array but returns null"

* Fixed "should return string but returns null"

* Fixed "should return int but returns null"

* Fixed "should return bool but returns"

* Fixed docs (see comments)

* Fixed "should return array"

* Update app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Abstract.php

Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com>

* Update app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api.php

Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com>

* Update app/code/core/Mage/Tag/Model/Resource/Tag.php

Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com>

* Update app/code/core/Mage/Customer/Block/Form/Register.php

Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com>

* Added module names to helper(#2617)

* Get catalog search result collection from engine (#2634)

* Add PHP dependencies security check workflow (#2639)

* [security-workflow] Fixed cron syntax (#2640)

* Added OpenMage Contributors Copyright (#2295)

* Added ddev snippets to docs (#2575)

* Improve dev/openmage/install.sh script for newer versions of Docker - no longer requires separate compose.

* Only run workflows when relevant files change (#2641)

* Add back notification popup severity icons URL (#2633)

* Reduce reprocessed jpeg file size by defaulting quality to 85% (#2629)

* Fixed issue #475.

* Removed <frontend_type>text</frontend_type> as it is the default.

* Fixed bug on users not able to modify image quality in backend if deprecated config exists.

* Fixed bug on incorrect check if image quality was not set in backend.

* Improved note in system.xml.

* Prevented editing of a non-editable order (#2632)

* Fix dev/openmage/install.sh script setting permissions on var directory.

* Allowed automatic full invoice from API (#2393)

* Add check if array key isset before using it (#2649)

* Fixed phpstan-baseline.neon

* Fixed phpstan-baseline.neon (updated dev tools)

* Revert "Fixed phpstan-baseline.neon"

This reverts commit 3c82e76.

* Fixed getRegion()

Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com>
Co-authored-by: Mohamed ELIDRISSI <67818913+elidrissidev@users.noreply.github.com>
Co-authored-by: Justin Beaty <51970393+justinbeaty@users.noreply.github.com>
Co-authored-by: Colin Mollenhour <colin@mollenhour.com>
Co-authored-by: luigifab <31816829+luigifab@users.noreply.github.com>
Co-authored-by: Przemysław Piotrowski <przemyslaw.p@deligo.pl>
@addison74
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants