The content of this article or any related information is under the Creative Commons license BY, you can republish this content freely but you must mention the author of this article: Kernel and indicate the URL of this page: https://www.exabyteinformatica.com/tienda/foro/magento-2-tool-chain-t1363.html
During this publish I review the typical ranges in a Magento 2 device chain, from construction to construction. This device chain is for websites using the Magento “building” and “construction” modes, not the less complicated “default” mode where you tend to function at once on the site.
There are adaptations, but I thought a useful to position the entire components onto a single diagram. And if I’m lacking something, please let me be aware of.
Please notice this one is a reasonably light weight put up. in case you remember right here diagram, you doubtless received get tons greater out of analysing the rest of this post.
Project supply info
While developing a undertaking, i like to recommend having the source info on your construction computer (your computing device or computer). Some manage their task supply files internal a VM or container. i like to recommend the use of the native file device without delay since it offers superior efficiency. As an instance, if the usage of Hypertext Pre-processor Storm and it performs a “reindex”, slower entry to the information is substantive. It additionally extra naturally fits in with native operating gadget equipment.
Edition control device
i like to recommend using a edition manage device (VCS) such as GIT, Mercurial, or SVN. It is not necessary, however there are loads of benefits together with tracking the historical past of your venture and making collaboration less complicated between developers.
All mission data for Magento sit down within a single listing tree. Developers work on and eventually set up projects. For Magento 2, there are ideas around what to versus now not to commit into the VCS, corresponding to “do not commit the supplier listing”. The vendor directory holds the code that isn't selected to your challenge. Diverse initiatives may additionally have some variations, but here is an instance that I discover a pretty good beginning point. However there are different data that don't seem to be customarily dedicated including minified CSS files created throughout the deployment method, and the media listing keeping photos for test products you created right through construction. i recommend ranging from a “ignore” checklist from an additional equivalent project, after which adapt as you go along.
I constantly recommend working the VCS tools natively to your development machine as they usually integrate closely with your IDE or textual content editor. For example, for home windows “Git Bash” offers an easy bash shell emulator and Git instructions.
Magento Cloud (the Magento internet hosting solution) makes use of a variation on this theme, the place committing to the VCS is how you perform deployments. Commit your code to the production branch and your code will be deployed instantly for you.
IDE / textual content Editor
To edit the source code of Magento you are going to want an integrated development ambiance (IDE) or textual content editor. Personal home page Storm (a commercial product) is a common IDE with Magento, however other options exist. An IDE differs from a simple text editor in that it has extra inbuilt equipment that builders commonly use. for instance, personal home page Storm that you can commit alterations to your VCS, review code background, run unit checks, refactor code, all from internal the IDE. Although, there are users who opt for the use of simpler textual content editors. Here is basically a depend of alternative. As an instance, I in my opinion often use vim from a command instant for short edits. And the power of personal home page Storm could be overkill in case you simplest edit CSS info.
Magento marketplace Repository
Magento industry lets you buy third celebration extensions so as to add to your web site. Magento 2 uses Composer to download the code into the challenge’s “seller” listing. The same Composer repository additionally holds the entire Magento CE, EE, and ECE code bases. So here's a valuable single location to down load all externally developed code.
Private Composer Repository
Modules developed peculiarly for a assignment are typically kept under app/code. Despite the fact, it is additionally common for a solution associate or merchant with distinct initiatives to create an interior repository of Composer applications to share throughout distinct tasks. This “repository” could be as simple as a GIT repo per module, or a full blown Composer repository developed with a tool comparable to Satis. Composer helps varied the right way to create shared substances that Composer can down load and add to a venture.
Personal home page construction atmosphere
A personal home page construction environment (as a minimum for the goal of this weblog put up) incorporates a collection of equipment enabling personal home page to be run from the command line or from interior an IDE. It’s sufficient with the intention to run unit checks, however not the total utility. As an example, it does not consist of MySQL or the internet server. A developer may also have a full suite of equipment working natively on their desktop, however is a standard contemporary vogue to run the total stack of equipment inside a VM or container. The php development atmosphere accessible locally is “simply enough” to run unit tests.
Note that php Storm helps working unit checks remotely (over SSH) by means of configuration of a “far flung interpreter”. This capacity if the developer is using a VM or container to run the total stack in, the VM/container can even be used to run unit exams, keeping off the need to set up a local php building environment. This additionally ensures consistency of environment configurations between builders (they'd customarily share the VM or container photo). This consequences in one fewer tools to be put in in the neighbourhood, but extra importantly consistency across builders.
Full Stack development environment
A full stack development ambiance contains the entire equipment required to run the Magento 2 software. This comprises Hypertext Preprocessor, the web server (Apache or NginX), MySQL, and so forth. It will possibly consist of Redis, Varnish, RabbitMQ, and extra, in keeping with how the developer wants to work. As above, a standard fashion is to use a VM or container (Vagrant and Docker are two common applied sciences right here) where all the tools are preinstalled. This allows builders on a venture to share exactly the same equipment and configurations, fending off time consuming problems the place one developer has problem that others don't encounter, as a result of some customized Hypertext Preprocessor configuration surroundings (e.g. a smaller reminiscence limit).
Use of VMs and containers also allow developers extra effortlessly swap between distinct setups suitable for distinctive client projects. As an instance, a Magento 1 task may additionally use an older edition of Hypertext Preprocessor. Installing php (or MySQL, Redis, Apache, and many others) natively can make it tougher for a person to switch between initiatives.
It’s worth noting that I do not name out a separate development environment for front end builders. Here is because whereas they may also use distinct tools such as Grunt or Gulp for CSS compilation, frontend builders want most of a full stack to look at various their adjustments and they also can also as well simply use the complete stack development atmosphere.
Integration, Staging, and construction Environments
Integration environments in the context of this blog submit refers to environments used to verify the comprehensive set of code and performance, equivalent to for a person acceptance trying out. A staging ambiance is frequently set up to mimic production as carefully as feasible (generally with less hardware to reduce costs) enabling new code drops to be demonstrated earlier than being rolled out into creation. By means of maintaining the staging environments as close as feasible to creation, the chance of construction deployment considerations is minimized. The creation environment is where the reside, transacting site runs.
There are additionally a number of equipment which are price calling out notably, concerning the blue arrows on the diagram: direct entry, Composer, file syncing, and deployment scripts.
Direct access as proven on the diagram without difficulty skill the equipment can access the undertaking info natively on the native file equipment.
Composer is a Hypertext Pre-processor equipment supervisor, proposing a typical approach to download third birthday celebration code, and performing version compatibility exams.
File equipment syncing tools are for sharing the challenge data saved natively on the development machine with the VM or container. Vagrant comprises an “rsync-auto” command that watches the native file gadget for adjustments, the use of rsync to then synchronize the local and VM/container listing tree. (See this Vagrantfile for a Magento 2 illustration.) Docker-sync offers the same mechanism to be used with Docker. Docker 1.12 additionally provides a file equipment sharing capacity, youngsters there are nevertheless teething problems around performance and absence of iNotify aid for home windows.
it's worth noting that here's a bi-directional syncing of info. Some alterations may still be pushed from the project info into the VM/container, such local modules or topics. Other adjustments are pulled from the VM/container back to the local file equipment for access by the IDE for debugging (single stepping via code in an IDE requires the IDE to have access to any code generated within the VM/container).
Deployment scripts are additionally needed to take the set of information within the task, run compilation steps on the task to generate optimized files, and then deploy the combination of native undertaking source data, third birthday celebration files, generated information from compilation and have them all deployed to an integration or creation atmosphere. “Static asset compilation” and “di-compilation” fall into the deployment technique.
I regularly get away “construct” as a subset of the deployment manner, which is all the actions that may ensue without the web site being unavailable. There has been loads of recent effort inside Magento to speed up the deployment steps and make them feasible to execute on a server devoid of database access (to make them less difficult to run in a deployment pipeline). Some work has already been launched in patches, with greater deliberate for future 2.1 patches and the next 2.2 liberate. The simplest cause a site may still stay down for a sizeable duration right through a typical deployment process is to perform any database schema updates.
The purpose of this blog was to give an outline of the number of steps within the Magento tool chain, principally for new builders. A couple of full-stack environments had been created for setting up with Magento (I even have blogged on a number of these in the past). The sample of utilization is youngsters basically the identical. I have additionally up to now blogged on the separation of construction environments from deployment methods.
Magento is exploring a “ordinary” Docker based mostly full-stack development graphic, as a baseline reference photograph. I have been asserting “coming soon” for a short time now – sorry, we hit some surprising issues with the Docker 1.12 host OS file sharing characteristic in the areas of pace for MacOS and iNotify for home windows. However it is coming.
It’s feasible that more than one such full-stack image will in the end be supported (e.g. one the usage of Vagrant and one the usage of Docker). Here is still to be determined. It’s value noting the reliable Magento photo will not always be “more suitable” than other pictures already obtainable in the group, simply “general”. For instance, if an issue can be with no trouble repeated on the Magento ordinary graphic it will make it less difficult for Magento to repeat mentioned problems internally without environmental differences. This means there isn't any reason not to discover a latest container for a building applications.
It is price noting that the image will now not handle deployment. Deployment is particular to your internet hosting configuration. One aim of sharing the above diagram became to assist with any discussions around the ranges of Magento 2 utility building average.
No te pierdas el tema anterior: Should you improve to Magento 2?
Salta al siguiente tema: The way to migrate from Magento to Woocommerce
Quizás también te interese: