Skip to content

Commit

Permalink
DIGITAL-176: Move drupal env lando info into Contributing.md.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsqd committed Nov 18, 2024
1 parent b169472 commit 72e5543
Showing 1 changed file with 54 additions and 6 deletions.
60 changes: 54 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@
- [Git](#git)
- [Content](#content)
- [Validation](#validation)
- [Updating Dependencies](#updating-dependencies)

## Getting Started
## Software Requirements

* PHP 8.3: Used to run `./robo.sh` / `./composer.sh` tasks
* Composer Version 2: https://getcomposer.org/, much faster to run composer locally than through docker.
* Lando: https://lando.dev/download/

To get started with a local environment, please see the Wiki for the [Drupal Env Lando](https://github.com/mattsqd/drupal-env-lando/wiki) project.
## Getting Started

TLDR:
* This is just a lando site, all lando commands are available.
* First time: `./robo.sh lando:init`
* Starting Lando: `lando start`
* Installing a Drupal site from config (no DB needed): `lando si`
* If switching to a new branch, always: `lando rebuild -y && lando si` to start off completely fresh.
* See a list of shortcuts (Drush, Composer, etc.): `./robo.sh common:shortcuts-help`
* Make sure that you use `./composer.sh` instead of `composer` or `lando composer`. `./composer.sh` will cause entries `composer.log` to be made so we can replay composer commands on conflicts.
* Use `./composer.sh` instead of `composer` or `lando composer`. `./composer.sh` will cause entries `composer.log` to be made so we can replay composer commands on conflicts.
* Sign in as admin: `./drush uli`

## Git
Expand All @@ -30,7 +35,7 @@ The content for development is created via the [Default Content](https://www.dru

How do I install the content?

Content is created from the config stored at `web/modules/custom/default_content_config/content` when the site is installed.
Content is created from the config stored at `web/modules/custom/default_content_config/content` when the site is installed (`lando si`).

How do I create more content?

Expand All @@ -40,7 +45,7 @@ Simply edit or add new content, then run `./robo.sh drupal-project:export-conten

## Validation

* Uses [RoboValidate](https://github.com/mattsqd/robovalidate) to run the various validations.
* Uses RoboValidate to run the various validations.
* Can be run manually locally via: `./robo.sh validate:all`
* Is run when any branch is pushed to GitHub via GitHub Actions. Validation on Git commits is only run remotely when a pull request is made so that only new commits are checked.

Expand All @@ -59,3 +64,46 @@ See the [coding standards](https://www.drupal.org/docs/develop/standards) docume
#### IDE

[Enable coding standards help in your IDE](https://www.drupal.org/docs/extending-drupal/contributed-modules/contributed-module-documentation/coder/installing-coder#s-ide-and-editor-configuration) so you're not surprised by a bunch of errors when you push up.

## Updating Dependencies

### Ensure that your local is OK to destroy:

`git status`

If you are working on something right now:
`git stash && lando db-export backup.sql`

When finished updating dependencies:
`git checkout feature/my-old-branch && git stash pop && lando db-import backup.sql`

### Updating
```
git fetch
git checkout develop
git reset --hard origin/develop
lando rebuild -y
lando si
git checkout -b feature/DIGITAL-[TICKET-NUMBER]-update-dependencies
./composer.sh update
./drush.sh updb -y
./drush.sh cex -y
```

Commit the changes to composer.* and any config files updated from database updates.

The next step is to run scaffolding:

`./robo.sh drupal-env:scaffold-all`

Not everything in here needs to be committed. Somethings that will show as updates will be the overrides added in the past. Make sure to revert any changes that were not intended.

Commit the scaffolding changes.

The final step is to run validation. This is important as part of the dependency updates might be new coding standards rules that will need to be fixed.

`./robo.sh validate:all`

Fix any validation errors and commit.

`git push origin`

0 comments on commit 72e5543

Please sign in to comment.