1. Clone/fork this repository
This is a project template. Fork/clone it to start your new project.
2. DDEV is required
This build requires ddev to be installed on your local machine. You can install it by following ddev installation guide located here https://ddev.readthedocs.io/en/stable/users/install/ddev-installation/#linux.
$ mkdir [your project name/domain] && cd [your project name/domain]
$ git clone [email protected]:droptica/CLONED-REPOSITORY-NAME.git .
In repository directory run command:
ddev config
- Project name: [your project name]
- Docroot: [enter] (default: docroot web)
- Create docroot directory: [y]
- Project type: select from list (default: drupal10)
ddev start
After project configuration run command to install composer dependencies:
ddev composer install
If you have problems with the authorization, add ssh key authentication to the ddev-ssh-auth container:
ddev auth ssh
ddev drush site:install --config-dir=../config/sync --account-name=admin --account-pass=123 -y
Set the GIN as a default theme:
ddev drush theme:install gin -y
ddev drush config-set system.theme admin gin -y
Also, you can enable the common modules:
ddev drush en admin_toolbar admin_toolbar_tools config_split security_review site_audit -y
Update the config_sync_directory
in the settings.php
file:
$settings['config_sync_directory'] = '../config/sync';
Define the DATA_DEV_SERVER
variable in the .ddev/commands/host/download-data
file to be able to download latest data from the server.
ddev download-data
ddev build
ddev drush <params> - Normal drush command, what did you expected here? :D
ddev composer <params> - Same as above but with composer :D
ddev download-data - Download latest database and files from defined server
ddev build - Run normal default procedure
ddev platform - Run pull platform command to get fresh database and files from PLATFORM_ENVIRONMENT in the config
ddev db-restore - Restore db from local dump located at '.ddev/db-dumps'
ddev files-import - Import all files from local dump located at 'ddev/file-dumps'
Define the THEME_PATH
variable in the .ddev/commands/web/theme
file to be
able to build the assets.
ddev theme - Compile all styles for defined theme
ddev get ddev/ddev-phpmyadmin - Get PhpMyAdmin container
Any other useful command from ddev you can find by simply typing ddev
into
your terminal.
ddev phpcs
ddev phpcbf
ddev phpstan
ddev compatibility
ddev compatibility 8.1 web/modules/custom
ddev compatibility 8.2 web/modules/custom web/themes/custom
ddev compatibility 8.2 web/modules/custom web/themes/custom > report.txt
ddev auto-update
Documentation: README.
This template contains the base configuration of the github actions and bitbucket pipelines to check quality of your code with the PHP CodeSniffer and PHP Stan tools.
Base usage doesn't need any configuration, just enable actions/pipelines in your repository settings.
The project documentation is located in the docs
directory:
Documentation
This is instructions for running the template locally, connected to a live database instance on an active Platform.sh environment.
In all cases for developing with Platform.sh, it's important to develop on an isolated environment - do not connect to data on your production environment when developing locally. Each of the options below assume that you have already deployed this template to Platform.sh, as well as the following starting commands:
platform get PROJECT_ID
cd project-name
platform environment:branch updates
DDEV provides an integration with Platform.sh that makes it simple to develop Drupal locally. Check the providers documentation for the most up-to-date information.
In general, the steps are as follows:
- Install ddev.
- A configuration file has already been provided at
.ddev/providers/platform.yaml
, so you should not need to runddev config
. - Retrieve an API token for your organization via the management console.
- Add the API token to the
web_environment
section in your global DDEV configuration at~/.ddev/global_config.yaml
:web_environment: - PLATFORMSH_CLI_TOKEN=abcdeyourtoken
- Run
ddev restart
. - Get your project ID with
platform project:info
. If you have not already connected your local repo with the project (as is the case with a source integration, by default), you can runplatform project:list
to locate the project ID, andplatform project:set-remote PROJECT_ID
to configure Platform.sh locally. - Update the
.ddev/providers/platform.yaml
file for your current setup:environment_variables: project_id: PROJECT_ID environment: CURRENT_ENVIRONMENT application: drupal
- Get the current environment's data with
ddev pull platform
. - When you have finished with your work, run
ddev stop
andddev poweroff
.
Note:
For many of the steps above, you may need to include the CLI flags
-p PROJECT_ID
and-e ENVIRONMENT_ID
if you are not in the project directory or if the environment is associated with an existing pull request.