eaudeweb / heavy-lifter
Common commands for your Drupal project to get you up to speed
Installs: 24 956
Dependents: 4
Suggesters: 0
Security: 0
Stars: 1
Watchers: 13
Forks: 3
Open Issues: 7
Requires
- php: >=7.3
- ext-json: *
- eaudeweb/robo-curl: 2.0.0-alpha4
- webflo/drupal-finder: ^1.2
Suggests
- eaudeweb/gdpr-dump: 1.0.6
- dev-master
- 2.x-dev
- 2.0.0-alpha8
- 2.0.0-alpha7
- 2.0.0-alpha6
- 2.0.0-alpha5
- 2.0.0-alpha4
- 2.0.0-alpha3
- 2.0.0-alpha2
- 2.0.0-alpha1
- 1.4.6
- 1.4.5
- 1.4.4
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.9
- 1.3.8
- 1.3.7
- 1.3.6
- 1.3.5
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.9
- 1.2.8
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.9
- 1.0.8
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-20661-drush-deploy
- dev-20661-drush-deploy-v2
- dev-2.x-hook-deploy
- dev-Anthelixes-integrity-check
- dev-9184-robo-optional
- dev-3-maintenance-mode
- dev-15-fix-docroot-reference
- dev-19-fix-commands-ordering
- dev-6467-windows-server
- dev-6395-sql-dump-anonymize
- dev-6408_update_readme
- dev-6345-fix-site-update
- dev-6345_fix_site_update
- dev-develop
- dev-6138_robo_yml_refactorization
- dev-6156_enhancement_for_site_develop
- dev-post-command-scripts
- dev-5871_improvements
- dev-sql-sync
This package is auto-updated.
Last update: 2024-11-18 10:51:56 UTC
README
Doing the heavy lifting for local Drupal development.
Installation
https://packagist.org/packages/eaudeweb/heavy-lifter
Drupal 8
-
Install the heavy-lifter with composer :
composer require eaudeweb/heavy-lifter
-
Execute the configuration script for heavy-lifter :
./vendor/bin/robo site:config
-
Copy
example.robo.yml
torobo.yml
, customize the username and password to the ones provided by system administrator -
(Optional) You can add excluded drush commands to any of heavy-lifter's robo commands in
robo.yml
Example :
site:
update:
excluded_commands:
- locale:check
- yyy
- (Optional) You can add extra drush commands to any of heavy-lifter's robo commands in
robo.yml
Example:
site:
update:
extra_commands:
- locale:update
- Execute
./vendor/bin/robo sql:sync
to see if the installation successfully worked
Drupal 7
The installation guideline on Drupal 7 is the same as the one on Drupal 8, just a few observations are necessary:
- Not all the available robo commands are available for Drupal 7 websites. (Some commands commit modifications available only to Drupal 8 websites and therefore have not been implemented/tested on Drupal 7)
How to use it inside a project
Note: You run all commands from the project's root folder (i.e. where you store the web/
folder).
-
Copy
example.robo.yml
torobo.yml
and customize the username and password to the ones provided by system administrator -
Get the database dump and import:
./vendor/bin/robo sql:sync
-
Update the site's configuration and database :
./vendor/bin/robo site:update
-
Get the files archive:
./vendor/bin/robo files:sync
-
Create archive with files directory to the given path :
/vendor/bin/robo files:dump [destination]
-
Enable development:
./vendor/bin/robo site:develop
-
Download the database dump from the remote storage, without importing it :
/vendor/bin/robo sql:download [destination]
Custom development scripts
If you want to run custom drush scripts at the end of the site:develop command, add these scripts in the PROJECT/etc/scripts/develop folder.
Database anonymize
- Run
composer require eaudeweb/gdpr-dump
- Define your anonymize schema in an anonymize.schema.yml file, in the project root (in the same folder as robo.yml)
- Run
./vendor/bin/robo sql:dump --anonymize
Row values listed under ignored_values will not be anonymized.
anonymize.schema.yml example
users_field_data:
name:
formatter: email
exclude: # the rows that have these values will NOT be anonymized
uid: [1, 76, 228, 81, 116, 117, 149, 393]
telephone:
formatter: phoneNumber
mail:
formatter: email
unique: true
exclude:
uid: [1, 76, 228, 81, 116, 117, 149, 393]
conditions_action: ignore
pass:
formatter: password
preferred_admin_langcode:
formatter: clear
table2:
column1:
formatter: randomText
include: # only the rows that have these values will be anonymized
name: ['Name to anonymize']
rand_num
formatter: randomNumber
arguments: [6] # argument passed to the randomNumber() function from the Faker library, max 6 digits
taxonomy_term_field_revision:
name:
formatter: company
include: # you can also use SELECT queries to define your list of included rows. The select query MUST only select ONE column
tid: SELECT tid FROM taxonomy_term_field_data WHERE vid = "partners"
...
Formatter types
- name - generates a name
- phoneNumber - generates a phone number
- username - generates a random user name
- password - generates a random password
- email - generates a random email address
- date - generates a date
- longText - generates a sentence
- number - generates a number
- randomText - generates a sentence
- text - generates a paragraph
- uri - generates a URI
- clear - generates an empty string
For more information about available formatters, check https://github.com/fzaninotto/Faker#formatters
Observations for Windows environment:
- only command
sql:dump
is available - robo path is
./vendor/consolidation/robo/robo
Multisite
For multisites, create another key under sites
in robo.yml
and configure it similar to sites:default
.
To run a command on a sub site, use the --site SITE
argument.
Example:
robo.yml:
sites:
default:
...
subsite:
...
./vendor/bin/robo sql:sync --site subsite