|
| 1 | +--- |
| 2 | +# Template playbook for a local Drupal9 codebase. |
| 3 | +- hosts: {{ project_name }}-web |
| 4 | + vars: |
| 5 | + - project_name: {{ project_name }} |
| 6 | + - project_type: drupal8 |
| 7 | + - webroot: web |
| 8 | + - build_type: local |
| 9 | + - _env_type: dev |
| 10 | +{% raw %} |
| 11 | + - _domain_name: www.{{ project_name }}.local |
| 12 | + # Path to your project root. This must match the "volume" set in the docker-compose template. |
| 13 | + - deploy_path: /home/ce-dev/deploy/live.local |
| 14 | + # This actually does not take any backup, but is needed to populate settings.php. |
| 15 | + - mysql_backup: |
| 16 | + handling: none |
| 17 | + credentials_handling: static |
| 18 | + # A list of Drupal sites (for multisites). |
| 19 | + - drupal: |
| 20 | + sites: |
| 21 | + - folder: "default" |
| 22 | + public_files: "sites/default/files" |
| 23 | + install_command: "-y si" |
| 24 | + # Toggle config import on/off. Disabled for initial passes. |
| 25 | + config_import_command: "" |
| 26 | + # config_import_command: "cim" |
| 27 | + config_sync_directory: "config/sync" |
| 28 | + sanitize_command: "sql-sanitize" |
| 29 | + # Remove after initial pass, to avoid reinstalling Drupal. |
| 30 | + force_install: true |
| 31 | + base_url: "https://{{ _domain_name }}" |
| 32 | + # Composer command to run. |
| 33 | + - composer: |
| 34 | + command: install |
| 35 | + no_dev: false |
| 36 | + working_dir: "{{ deploy_path }}" |
| 37 | + apcu_autoloader: false |
| 38 | + pre_tasks: |
| 39 | + # You can safely remove these steps once you have a working composer.json. |
| 40 | + - name: Download composer file. |
| 41 | + get_url: |
| 42 | + url: https://raw.githubusercontent.com/drupal/recommended-project/9.3.x/composer.json |
| 43 | + dest: "{{ deploy_path }}/composer.json" |
| 44 | + force: false |
| 45 | + - name: Install drush. |
| 46 | + command: |
| 47 | + cmd: composer require drush/drush:11.* |
| 48 | + chdir: "{{ deploy_path }}" |
| 49 | + roles: |
| 50 | + - _init # Sets some variables the deploy scripts rely on. |
| 51 | + - composer # Composer install step. |
| 52 | + - database_backup # This is still needed to generate credentials. |
| 53 | + - config_generate # Generates settings.php |
| 54 | +# - sync/database_sync # Grab database from a remote server. |
| 55 | + - database_apply # Run drush updb and config import. |
| 56 | + - _exit # Some common housekeeping. |
| 57 | +{% endraw %} |
0 commit comments