backdrop / backdrop-issues

Issue tracker for Backdrop core.
144 stars 40 forks source link

[DX] Add .lando.yml file to backdrop/backdrop for ease of development #2759

Closed serundeputy closed 6 years ago

serundeputy commented 7 years ago

Describe your issue or idea

In https://github.com/backdrop/backdrop-issues/issues/658 we introduced a .editorconfig file into backdrop core to ease text editor configuration.

In this issue I propose adding a .lando.yml file to ease setting up a development stack and lowering the bar for entry into Backdrop development. The .lando.yml file will not affect anyone not using lando, but will make it really easy for developers to start developing backdrop sites.

Desired behavior


PR: https://github.com/backdrop/backdrop/pull/1922

serundeputy commented 7 years ago

Here is the proposed .lando.yml file:

##
# You can use this file to easily spin up a development stack for your Backdrop
# sites using the Lando dev stack.
#
# Lando is a free, open source and cross-platform local development environment
# tool built on Docker container technology. It is the successor project to
# Kalabox.
#
# You can read more about the lando project and its full capabilities here:
# https://docs.lndo.io/
#
##

# Change this to your sitename like `my-project` or `sso-company`.
# Backdrop recipe
name: my-backdrop

# Start with the default Backdrop recipe
recipe: backdrop

# Configure the Backdrop recipe
config:

  # See: https://backdropcms.org/requirements

  # Optionally specify the php version to use.
  #
  # If ommitted this will default to the latest php version supported by Backdrop.
  # Consult the `php` service to see what versions are available. Note that all
  # such versions may not be supported in Backdrop 6 so YMMV.
  #
  # See: https://backdropcms.org/requirements
  #
  # NOTE: that this needs to be wrapped in quotes so that it is a string
  #
  # You can use one of '5.3', '5.5', '5.6', '7.0' or '7.1' here for PHP
  # versions.
  #
  php: '7.0'

  # Optionally specify whether you want to serve Backdrop via nginx or apache
  #
  # If ommitted this will default to the latest apache
  #
  # See: https://backdropcms.org/requirements
  #
  # via: nginx

  # Optionally specify the location of the webroot relative to your approot.
  #
  # If ommitted this will be your approot itself.
  #
  # webroot: www

  # Optionally specify the version of Backdrush you want for your site
  #
  # This can be either
  #   - `stable`
  #   - `dev`
  #   - `any valid git ref for which there will be a github download` eg 0.0.3
  #
  # If ommitted this will use the stable Backdrush.
  #
  backdrush: stable

  # Optionally specify the database type, this can be one of:
  #
  #   - `mysql`
  #   - `mariadb`
  #
  # If ommitted this will default to the latest mysql. You can additionally provide
  # a version with `type:version` but you will need to consult the documentation
  # for the correct DB service to see what versions are available
  #
  # See: https://backdropcms.org/requirements
  #
  database: mariadb

  # Optionally activate xdebug
  xdebug: true

  # Optionally mix in your own config files
  #
  # If ommitted this will use the default Backdrop config files for the respective
  # services.
  #
  # Definitely consult the relevant documentaion for each service to make sure
  # you are specifying the correct value for the config.
  #
  # conf:
    # server: config/backdrop.conf
    # database: config/mysql
    # php: config/php.ini

# The Backdrop recipe is super slick but we want to augment this recipe so we can
# run our front end tooling magix
services:
  # Uncomment this 'appserver' key if you would like to
  # inject a pre-run script
  # appserver:
  #   scripts:
  #     - scripts/my-script.sh
  #
  # To fix your database connection port, useful if you want to have shortcuts
  # to your database connection in a helper app like SequelPro, you can
  # uncomment thes lines (be sure to comment out or remove the 'database:' key
  # above).
  # database:
  #   type: mariadb:latest
  #   portforward: 3339
  #
  node:
    type: node:6.10
  cache:
    type: redis
    persist: true
tooling:
  redis-cli:
    service: cache
  node:
    service: node
  npm:
    service: node
jlfranklin commented 7 years ago

I like the idea of providing a baseline configuration, but I don't believe it belongs in the core repository. Let me explain why.

Right now, there are three dot files in the project's root: .htaccess, .gitignore, and .editorconfig.

The .htaccess file is there to support clean URLs, hide some files for security reasons (.info, .module, disable Indexes, etc.), and provide some (IMHO) convenience rewrite rules for common deployment issues, like SSL and docroots. It has real, operational value to the majority of users, and makes it easier for hosting companies to support Backdrop without any special settings in their master webserver configs, beyond "allow overrides."

The .gitignore defines files that have no business in the core Backdrop git repo. It services the Backdrop project per-se, not just site developers building their sites in their own Git repos. Yes, it supports a specific VC package, but it is the package that Backdrop uses. If the world were to come up with a generic .vcignore format, I'd argue we rename it.

The .editorconfig file is not specific to any particular editor. Most modern editors understand the .editorconfig file directly or through plugins. (The rest, it could be argued, don't yet.) Like .gitignore, it directly services the Backdrop project by defining and helping enforce coding standards of PRs entering the Backdrop repository, but without playing favorites to any particular editor. We would never include a .vimrc file, for example.

The .londo.yml is project specific, does not affect anything going into the Backdrop code, nor provide a feature set that meets the 80% rule. I don't think this belongs in the Backdrop project itself, and adding it would open the doors to adding dozens of dot files for all manner of third-party projects.

Instead, I think it would be better to add a section to the Backdrop website for integrating Backdrop with other projects. The Londo page in that section would include this file and a how-to on setting up Backdrop with Londo.

klonos commented 7 years ago

Although this might be a 3rd-party, project-specific file @jlfranklin, I don't see any harm in including it (or any other 3rd-party config files for that matter). It won't hurt people that are not using lando, while it would simplify things for people using it.

serundeputy commented 6 years ago

We have some local dev solt'ns outlined on https://backdropcms.org/try-backdrop.

closing this.