Skip to content

Commit

Permalink
Clarify
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman committed May 2, 2023
1 parent 25269c8 commit c2ba0d6
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
DDEV integration for developing Drupal contrib projects. This project reuses the code and approach from the [Drupal Association's Gitlab CI workflow](https://git.drupalcode.org/project/gitlab_templates/). It should work for any contrib project, including those that havent [opted into Gitlab CI](https://www.drupal.org/project/infrastructure/issues/3261803). One advantage of that is that failures in CI are more likely to be reproducible locally when using this integration.
DDEV integration for developing Drupal contrib projects. This project reuses the code and approach from the [Drupal Association's Gitlab CI workflow](https://git.drupalcode.org/project/gitlab_templates/).

As a general philosophy, Your contributed module is the center of the universe. It lives at the root of your codebase.
As a general philosophy, your contributed module is the center of the universe. You should `git clone` it and this directory becomes the root of your codebase.

Usage
Install
===========
1. `git clone` your contrib module
2. [Add DDEV to your contrib project](https://ddev.readthedocs.io/en/latest/users/project/) if not already added.
3. Run `ddev get weitzman/ddev-drupal-gitlabci`.

Commands
============
- Git clone your project from drupal.org.
- [Add DDEV to your contrib project](https://ddev.readthedocs.io/en/latest/users/project/) if not already added.
- Run `ddev get weitzman/ddev-drupal-gitlabci`. From now on, each time you start DDEV, your module gets symlinked into the `web/modules/custom` directory so that Drupal can find it (see the [expand-composer-json](https://github.com/weitzman/ddev-drupal-gitlabci/blob/main/commands/web/expand-composer-json)) command.
- Run `ddev expand-composer-json`. This edits composer.json so that `drupal/core-recommended` becomes a dev dependency.
- Run `ddev composer install` or `composer install`
- Run tests, appending options and arguments as needed.
- `ddev phpunit`
- `ddev nightwatch`
- `ddev phpcs`
This project provides the following DDEV container commands.

- [ddev expand-composer-json](https://github.com/weitzman/ddev-drupal-gitlabci/blob/main/commands/web/expand-composer-json). This edits composer.json so that `drupal/core-recommended` becomes a dev dependency. After this runs you may want to run `ddev composer install`
- [ddev symlink-project](https://github.com/weitzman/ddev-drupal-gitlabci/blob/main/commands/web/symlink-project). This symlinks the top level files of your project into web/moduels/custom so that Drupal finds your module. This command runs automatically on every `ddev start`.
- `ddev phpunit`. Run phpunit tests on the web/modules/custom directory.
- `ddev nightwatch`. Run nightwatch tests on the web/modules/custom directory.
- `ddev phpcs`. Run phpcs on the web/modules/custom directory.
- `ddev eslint`. Run eslint on the js files in the web/modules/custom directory.
- `ddev stylelint`. Run stylelint on the css files in the web/modules/custom directory.

Misc
=======
- Optional: [Install Chrome service for FunctionalJavascript and Nightwatch tests](https://github.com/ddev/ddev-selenium-standalone-chrome).
- Optional. Commit the changes .ddev after this plugin installs. This saves other users from having to run this command. Rerun the `ddev get` in order to update the commands from this project.
- This project reads your `project_type` from DDEV and fetches adds the corresponding version of `drupal/core-recommended` to composer.json. if you are doing something non-standard with project_type, just don't use `ddev expand-composer-json` command.
- Optional. Commit the changes .ddev after this plugin installs. This saves other users from having to install this integration. Rerun the `ddev get` in order to update the commands from this project.
- This project reads your `project_type` from DDEV and fetches adds the corresponding version of `drupal/core-recommended` to composer.json. if you are doing something non-standard with project_type, don't use `ddev expand-composer-json` command.
- This project should work for any contrib project, including those that haven't [opted into Gitlab CI](https://www.drupal.org/project/infrastructure/issues/3261803). One advantage of that is that failures in CI are more likely to be reproducible locally when using this integration.
- If you add/remove a root file or directory, re-symlink root files via EITHER of these methods
- `ddev restart`
- `ddev symlink-project`
- To sign up for Gitlab CI, see https://www.drupal.org/project/infrastructure/issues/3261803.

**Contributed and maintained by [@weitzman](https://github.com/weitzman)**

0 comments on commit c2ba0d6

Please sign in to comment.