I’m a bit stuck with installing farmOS via Composer onto DDEV.
I’ve tried the recommended options on the documentation (Docker and Github clone, even tried manually downloading the source code), but none have worked.
I would have expected to either: composer create-project farmos/composer-project my_farm --no-install and then configure DDEV and run composer install
Or install Drupal 9 into DDEV, then make a requirement with composer require farmos/farmos but that fails, even if Drupal 9.5.8 is specified.
Neither has worked. Any suggestions, or should this be raised as an issue?
I can’t speak to this myself because I don’t use DDEV, but I know that both @paul121 and @pcambra do, and I know it’s possible with farmOS.
If you can provide any more details on the issues you ran into with the official farmOS.org documentation, perhaps I can help work through that with you.
Thanks @wotnak it was the composer create "farmos/project:^2" that sorted it
This would be really useful to add to the documentation at Getting started | farmOS as it would help those using DDEV or Lando (and probably most other local dev setups).
Is there an Github issue queue for the documentation, as it would be easy to create a PR for this?
I’m wary about adding DDEV/Lando specific stuff to the “official” development environment instructions, because a) I don’t want to make either a dependency for the official instructions, and b) it means the maintainers need to ensure that the extra instructions continue to work in the future. That’s the beauty of community blog posts - they can be dated and focused on a specific context/workflow - and there’s less pressure for us to maintain their accuracy.
Yes! I’ve been using DDEV for well over a year and it makes me really happy. IMO it is much much easier to use for local development than our official docker workflow, especially when you are working on multiple “projects” and need separate environments for each one.
Here is my DDEV template that I copy/paste when starting new farmOS projects:
It also includes a few commands that help with my workflow of exporting the DB from a production site and importing locally for continued development. However, I’ve just noticed that since DDEV 1.19 PostgreSQL is a “first-class DB” so some of this may no longer be needed… will investigate that soon: Use DDEV first-class support for postgres · Issue #1 · paul121/farmos-ddev-template · GitHub
I mostly agree, but it would be nice if we could include a link in our official development docs that point to these other options so that they are more visible. In my experience I have seen a much higher success rate when pointing people to using DDEV vs our custom docker instructions A big problem that DDEV solves is the docker compatibility/performance issue across different operating systems.
Example: I work on a project with .ddev configuration commited. I shared DDEV installation instructions with 2 devs, one using Mac, one using Windows. All they needed was git clone, ddev start, copy DB dump then ddev pgsql_import and they were up and running.
DDEV currently supports postgresql natively, so all that have to be done is to set database type to postgres. It also allows to use ddev import-db --src=path/to/dump.sql.gz command to import database dump to postgres db.
When it comes to php-geos it must be installed in the way paul121 had done it in GitHub - paul121/farmos-ddev-template: Template for farmOS development with DDEV, but it can be simplified by creating custom ddev addon that will allow installing php-geos using single command (ddev get <addon>) without manually modifying any files.
We should probably give some thought to adding tagged releases to the farmOS/composer-project repository, so that composer create-project farmos/project works as expected.