Skip to content

Commit 845c62f

Browse files
authored
66912: Added Drupal10 template (#144)
* 66912: Added Drupal10 template * 66912: Added post_tasks section * 66912: Updated version to 1.2.4 * 66912: Recovered drupal8 * 66912: Fixed drupal10 text
1 parent c56b900 commit 845c62f

File tree

13 files changed

+285
-5
lines changed

13 files changed

+285
-5
lines changed

RELEASE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
1.2.3
2-
Updating containers to Debian 11 (Bullseye).
1+
1.2.4
2+
Added Drupal 10 template.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ce-dev",
33
"description": "Local Stack wrapper tool",
4-
"version": "1.2.3",
4+
"version": "1.2.4",
55
"author": " @pm98zz-c",
66
"bin": {
77
"ce-dev": "./bin/run"

src/commands/create.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export default class CreateCmd extends BaseCmd {
8080
choices: [
8181
'drupal8',
8282
'drupal9',
83+
'drupal10',
8384
'localgov',
8485
'blank',
8586
],

templates/drupal10/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
vendor
2+
node_modules
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.retry
2+
docker-compose.yml
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
# Template playbook for a local Drupal 10 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: manual
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+
- drush:
39+
use_vendor: true
40+
- drush_bin: "{{ deploy_path }}/vendor/drush/drush/drush"
41+
- lhci_run:
42+
# Create a list of URLs to test with LHCI
43+
test_urls:
44+
- "https://{{ _domain_name }}"
45+
pre_tasks:
46+
# You can safely remove these steps once you have a working composer.json.
47+
- name: Download composer file.
48+
ansible.builtin.get_url:
49+
url: https://raw.githubusercontent.com/drupal/recommended-project/10.1.x/composer.json
50+
dest: "{{ deploy_path }}/composer.json"
51+
force: false
52+
- name: Install drush.
53+
community.general.composer:
54+
command: require
55+
arguments: drush/drush:12.*
56+
working_dir: "{{ deploy_path }}"
57+
post_tasks:
58+
- name: "Symlink global Drush"
59+
ansible.builtin.file:
60+
src: "{{ drush_bin }}"
61+
dest: "/usr/local/bin/drush"
62+
state: link
63+
become: yes
64+
65+
roles:
66+
- _init # Sets some variables the deploy scripts rely on.
67+
- composer # Composer install step.
68+
- database_backup # This is still needed to generate credentials.
69+
- config_generate # Generates settings.php
70+
# - sync/database_sync # Grab database from a remote server.
71+
- database_apply # Run drush updb and config import.
72+
- _exit # Some common housekeeping.
73+
# - lhci_run # removing for now as something in D9 HTML breaks LHCI
74+
{% endraw %}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
- hosts: {{ project_name }}-web
2+
become: true
3+
vars:
4+
- _domain_name: www.{{ project_name }}.local
5+
- _env_type: dev
6+
- project_name: {{ project_name }}
7+
- rkhunter:
8+
allow_ssh_root_user: prohibit-password
9+
- mysql_client:
10+
host: {{ project_name }}-db
11+
user: root
12+
password: ce-dev
13+
{% raw %}
14+
- nginx:
15+
domains:
16+
- server_name: "{{ _domain_name }}"
17+
access_log: "/var/log/nginx-access.log"
18+
error_log: "/var/log/nginx-error.log"
19+
error_log_level: "notice"
20+
webroot: "/home/ce-dev/deploy/live.local/web"
21+
project_type: "drupal8"
22+
ssl:
23+
domain: "{{ _domain_name }}"
24+
cert: "{{ _ce_dev_mkcert_base}}/{{ _domain_name }}.pem"
25+
key: "{{ _ce_dev_mkcert_base}}/{{ _domain_name }}-key.pem"
26+
handling: "unmanaged"
27+
ratelimitingcrawlers: false
28+
is_default: true
29+
servers:
30+
- port: 80
31+
ssl: false
32+
https_redirect: true
33+
- port: 443
34+
ssl: true
35+
https_redirect: false
36+
upstreams: []
37+
- php:
38+
version:
39+
- 8.1
40+
cli:
41+
memory_limit: -1
42+
_env_type: dev
43+
fpm:
44+
_env_type: dev
45+
- php_composer:
46+
version: ''
47+
version_branch: '--2'
48+
keep_updated: true
49+
- xdebug:
50+
cli: true
51+
- lhci:
52+
enable_vnc: true
53+
- nodejs:
54+
version: 18.x
55+
- apt_unattended_upgrades:
56+
enable: false
57+
{% endraw %}
58+
tasks:
59+
- apt:
60+
update_cache: true
61+
- import_role:
62+
name: _meta/common_base
63+
- import_role:
64+
name: mysql_client
65+
- import_role:
66+
name: php-cli
67+
- import_role:
68+
name: php-fpm
69+
- import_role:
70+
name: nginx
71+
- import_role:
72+
name: lhci
73+
- import_role:
74+
name: frontail
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# @see https://github.com/drush-ops/drush/blob/master/examples/example.drush.yml
2+
3+
options:
4+
uri: '{{ site.base_url }}'
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
/**
4+
* Include default settings.
5+
*/
6+
require __DIR__ . '/default.settings.php';
7+
8+
/**
9+
* Include default local dev settings.
10+
*/
11+
require DRUPAL_ROOT . '/sites/example.settings.local.php';
12+
13+
$databases['default']['default'] = array (
14+
'database' => '{{ build_databases[0].name }}',
15+
'username' => '{{ build_databases[0].user }}',
16+
'password' => '{{ build_databases[0].password }}',
17+
'prefix' => '',
18+
'host' => '{{ build_databases[0].host }}',
19+
'port' => '3306',
20+
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
21+
'driver' => 'mysql',
22+
);
23+
24+
$settings['file_private_path'] = '{{ build_private_file_path }}';
25+
$settings['file_public_path'] = '{{ build_public_file_path }}';
26+
$settings['config_sync_directory'] = '{{ build_config_sync_directory }}';
27+
28+
/**
29+
* Load local development override configuration, if available.
30+
*/
31+
if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) {
32+
include $app_root . '/' . $site_path . '/settings.local.php';
33+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
version: '3.7'
2+
x-ce_dev:
3+
version: 1.x
4+
registry: 'localhost:5000'
5+
project_name: {{ project_name }}
6+
provision:
7+
- ce-dev/ansible/provision.yml
8+
deploy:
9+
- ce-dev/ansible/deploy.yml
10+
urls:
11+
- 'https://www.{{ project_name }}.local'
12+
services:
13+
web:
14+
image: 'codeenigma/drupal10-web:latest'
15+
platform: linux/amd64
16+
cgroup: host
17+
expose:
18+
- 443
19+
- 80
20+
x-ce_dev:
21+
host_aliases:
22+
- www.{{ project_name }}.local
23+
# Uncomment and comment the "volumes" below to use Unison file sync.
24+
# unison:
25+
# - src: ../
26+
# dest: /home/ce-dev/deploy/live.local
27+
# target_platforms:
28+
# - darwin
29+
# - linux
30+
# ignore:
31+
# - Name vendor
32+
# - Name node_modules
33+
# - Path */sites/*/files
34+
volumes:
35+
- ../:/home/ce-dev/deploy/live.local:delegated
36+
cap_add:
37+
- NET_ADMIN
38+
db:
39+
image: 'codeenigma/drupal10-db:latest'
40+
platform: linux/amd64
41+
environment:
42+
MYSQL_ROOT_PASSWORD: ce-dev

0 commit comments

Comments
 (0)