Ensure you have an Amazee account with your SSH keys loaded. If not reach out on the MidCamp Slack in #website-amazeeio
.
Refer to DDEV's documentation for detailed information on configuration, customization and troubleshooting.
- Start your local environment with
ddev start
- Run
ddev auth ssh
to load your ssh keys. - Import your local database and files via:
ddev pull lagoon
- Skip files/db with
--skip-files
or--skip-db
.gitpod.yml
adds support for developing in a fully web-based environment called GitPod. GitPod doesn't have a great solution for forwarding ssh keys yet, so in order to be able to pull from Amazee you have two options:
- [Add your existing SSH keys to GitPod (if you trust them)]gitpod-io/gitpod#666 (comment))
- Generate a new key pod and give it to Amazee - you'll have to do this on every new instance, but Amazee will recognize new keys basically instantaneously, so it isn't too bad.
- Lando (tested and working with version
v3.0.23
)
Refer to Lando's documentation for detailed information on configuration, customization and troubleshooting.
- Start your local environment with
lando start
- Import your local database and files via:
lando get-db
lando get-files
Some common Lando commands to be aware of:
lando start
starts your applicationlando stop
stops your applicationlando poweroff
stops Lando and any Lando apps currently runninglando restart
restarts your applicationlando rebuild
rebuilds your application and re-runs any build stepslando info
displays information about your local application, including relevant ports and connection info
All relevant tooling is included within the project containers, and as a result you can run all of this tooling from outside the containers by prefacing your commands with lando
, for example:
lando composer require drupal/pathauto
lando drush cache-rebuild
lando npm install
When beginning work on a task, start a new branch:
git checkout -b feature/my-great-work
Amazee workflows will build a new environment for every branch that begins with feature/
when it's pushed to GitHub. In order to access the environment for the branch above, visit https://nginx-midcamp-org-feature-my-great-work.us.amazee.io/. Databases for that environment are synced from Amazee dev, and it takes a few minutes after Circle completes for the install to complete.
To deploy a feature:
- merge your feature branch into
master
, - (optional but plz) give it a few minutes to sync, then test your work on https://dev.midcamp.org/
- merge
master
toproduction
.
See deploy_tasks
in .amazeeio.yml
for what happens after deploy (updb
, cim
, and more!)
This project uses Composer Installers and Drupal Composer Scaffold to assemble our Drupal root in web
. Dig into web
to find the both contrib Drupal code (installed by composer) and custom Drupal code (included in the git repository).
- Download modules with composer:
lando composer require drupal/bad_judgement:^8.1
- Enable the module:
lando drush en bad_judgement
- Export the config with the module enabled:
lando drush config-export
- Commit the changes to
composer.json
,composer.lock
, andconf/drupal/config/core.extension.yml
. The module code itself will be excluded by the project's.gitignore
.
The hatter theme has been flattened (it was a separate repo with Patternlab) to go to the theme folder, for best results use the npm version specified in .nvmrc
and then npm install
to get the dependencies for the build and then the following commands compile assets:
npm run build
- Builds CSS and JS oncenpm start
- Starts a watch process that will recompile CSS and JS whenever a change is made to the source.
If git conflicts occur in the:
- Compiled CSS or JS, run
npm run build
and add the result. - Source SCSS or JS file, first address the conflict, then run
npm run build
and add the result.
Sometimes we need to apply patches from the Drupal.org issue queues. These patches should be applied using composer using the Composer Patches composer plugin.
lando behat
lando phpcs features/bootstrap web/modules/custom
lando phpmd web/modules/custom text .phpmd.xml
- This should be configured to show the same errors triggered by Code Climate that you see on the Pull Request.
Be sure to visit Lando's troubleshooting page.
If your local development environment is behaving unexpectedly, you may need to do restart, reinstall, or rebuild your application. Try the commands below in order, the fastest/lightest options are at the top.
Command | Description |
---|---|
lando restart |
Restarts the app, preserving container state |
lando install |
Clean Drupal install |
lando rebuild |
Restarts the app, preserving data but not state |
Restart Docker | Can sometimes help build steps that time out |
lando destroy |
Destroys the app, preserves data |
rm -rf ~/.lando |
Clears your Lando cache |
If you are still using the old tooling from Amazee, please refer to the legacy documentation