Update cookies preferences

Magento 2 development on Gitpod

This article looks at a practical example of how we use Gitpod for our Adobe Commerce / Magento 2 development environments

I've been using Gitpod for Magento 2 development for 6 months now and it's really awesome.  As our agency Develo has grown the pain of wasting time setting up local development environments has multiplied and become a constant headache. 


Looking to learn Gitpod with Magento? Checkout or course here 

Gitpod Magento course


10 reasons Why Gitpod is awesome

1. Consistency, it stops the dreaded  "it works on my machine" every developer is instantly inline.

2. A single point of configuration, version control the environment requirements in Git along with the project code.

3. No worry about switching computers, the environment isn't tied to the physical device. 

4. No more switching node, npm, php versions between projects, 

5. No databases running locally, which lead to different versions and inconsistencies between local environments.

6. No heavy applications or services running on your local computer, keep your computer responsive at all times. 

7. Multi-task, even the fastest M1 MacBook can be slowed by running di:compile, indexer:reindex or importing or exporting databases on projects.

8. Remote help a colleague, take over their development environment in a single click.  No need to try to take remote control of their machine, as frustrating as that is!

9. Code reviews in an instant, take over a fully working separate instance of the site, dedicated to that branch only and see the code in action. 

10. Ephemeral Workspaces, make changes and don't worry about breaking the environment, as you can just delete it and boot a new one up instantly.


We already have Docker?

Yes Docker and other local virtualisation/container managers do help with lots of the problems stated above, but they don't fix some of the core local dev issues, not everyone has super fast computers, and OS or container software version discrepancies will always cause issues at some point when you least expect it. Plus the benefits of cloud development environments. 

Gitpod for Magento 2 

First off I'd like to say thanks to Askdjura and his work on starting the following repo, this was the inspiration for how we developed our build, you can checkout his Kitcken sink example on Github https://github.com/nemke82/magento2gitpod


His Gitpod example was great for testing out the idea, but we needed some changes to achieve a more practical development workflow. 


The ideal situation 

- A single click in Github from any context such as branch or Pull Request you work directly on that code only. 

- A fully working version build of the Magento store, with up to date database and images.

- There should be no files marked as changed in git

- Up and ready to start working on your tasks without any other input required.

- It's ready quickly, no lengthly downloads or build time.

And this is exactly what we've managed to achieve and it's awesome to use!


How Gitpod works

Gitpod is a cloud development environment platform https://www.gitpod.io . A completely isolated cloud server is setup on demand, they're not small 4-8 GB systems either, you get 64GB, fast CPU servers that don't struggle to run Magento 2. 

Each instance is given a unique URL and under HTTPS, you can easily have any ports on the server open as unique URL, either Private for you or Public where you can share the URL with anyone. 

Starting and stopping Instances

Gitpod workspaces can be stopped and started at any time, a workspace will be stopped if idle for more than an hour, or it can be extended to 3 hours idle as needed. 

Having an instance stop is not the end of the world, here are some rough estimates on start up time, from opening an instance to seeing the Magento site start in the browser. 


Start up times

- First time anyone has built a specific project : 15 mins

- Starting a project from a prebuilt image :  5 mins

- Opening a project that has been started and is idle : 10 seconds


As you can see it's very quick to get started, and the majority of the project starts are 5mins or less. 

Leon Paul


I'll be releasing a video guide, further tips & updates to this post over the rest of June, Sign up to the mailing list to be informed when that happens. ->


Ready to try it out?

1. Install the gitpod browser extension helper here 

2. Click the Gitpod button in our Github repo below, this will install Magento 2.4.3-p2.

Luma

If you have a question and want to open an issue on our Github repo, feel free!

If you enjoyed this article, read our other Learn articles to see more from our Magento developers or browse the site to see what else we do with Adobe Commerce, PunchOut Catalog and more.


Want to learn more about our services or speak to us about a project?


...
Luke

share:

Ready to start your next project?

See how we can help you accelerate your business