Skip to content

Commit b0dc9d9

Browse files
authored
Added Drupal9 and Localgov templates (#73)
1 parent e42ebd1 commit b0dc9d9

17 files changed

+478
-0
lines changed

src/commands/create.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ export default class CreateCmd extends BaseCmd {
7979
type: 'list',
8080
choices: [
8181
'drupal8',
82+
'drupal9',
83+
'localgov',
8284
'blank',
8385
],
8486
}])

templates/drupal9/.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: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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 %}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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+
- mysql_client:
8+
host: {{ project_name }}-db
9+
user: root
10+
password: ce-dev
11+
{% raw %}
12+
- nginx:
13+
domains:
14+
- server_name: "{{ _domain_name }}"
15+
access_log: "/var/log/nginx-access.log"
16+
error_log: "/var/log/nginx-error.log"
17+
error_log_level: "notice"
18+
webroot: "/home/ce-dev/deploy/live.local/web"
19+
project_type: "drupal8"
20+
ssl:
21+
domain: "{{ _domain_name }}"
22+
cert: "{{ _ce_dev_mkcert_base}}/{{ _domain_name }}.pem"
23+
key: "{{ _ce_dev_mkcert_base}}/{{ _domain_name }}-key.pem"
24+
handling: "unmanaged"
25+
ratelimitingcrawlers: false
26+
is_default: true
27+
servers:
28+
- port: 80
29+
ssl: false
30+
https_redirect: true
31+
- port: 443
32+
ssl: true
33+
https_redirect: false
34+
upstreams: []
35+
- php:
36+
version:
37+
- 7.4
38+
cli:
39+
memory_limit: -1
40+
_env_type: dev
41+
fpm:
42+
_env_type: dev
43+
- xdebug:
44+
cli: true
45+
- lhci:
46+
enable_vnc: true
47+
{% endraw %}
48+
tasks:
49+
- apt:
50+
update_cache: true
51+
- import_role:
52+
name: _meta/common_base
53+
- import_role:
54+
name: mysql_client
55+
- import_role:
56+
name: php-cli
57+
- import_role:
58+
name: php-fpm
59+
- import_role:
60+
name: nginx
61+
- import_role:
62+
name: lhci
63+
- import_role:
64+
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: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
/**
4+
* Include default settings.
5+
*/
6+
require __DIR__ . '/default.settings.php';
7+
/**
8+
* Include local dev settings.
9+
*/
10+
require DRUPAL_ROOT . '/sites/example.settings.local.php'
11+
12+
$databases['default']['default'] = array (
13+
'database' => '{{ build_databases[0].name }}',
14+
'username' => '{{ build_databases[0].user }}',
15+
'password' => '{{ build_databases[0].password }}',
16+
'prefix' => '',
17+
'host' => '{{ build_databases[0].host }}',
18+
'port' => '3306',
19+
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
20+
'driver' => 'mysql',
21+
);
22+
23+
$settings['file_private_path'] = '{{ build_private_file_path }}';
24+
$settings['file_public_path'] = '{{ build_public_file_path }}';
25+
26+
// Drupal < 8.8
27+
$config_directories['sync'] = '{{ build_config_sync_directory }}';
28+
// Drupal 8.8
29+
$settings['config_sync_directory'] = '{{ build_config_sync_directory }}';
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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/drupal8-web:latest'
15+
expose:
16+
- 443
17+
- 80
18+
x-ce_dev:
19+
host_aliases:
20+
- www.{{ project_name }}.local
21+
# Uncomment and comment the "volumes" below to use Unison file sync.
22+
# unison:
23+
# - src: ../
24+
# dest: /home/ce-dev/deploy/live.local
25+
# target_platforms:
26+
# - darwin
27+
# - linux
28+
# ignore:
29+
# - Name vendor
30+
# - Name node_modules
31+
# - Path */sites/*/files
32+
volumes:
33+
- ../:/home/ce-dev/deploy/live.local:delegated
34+
cap_add:
35+
- NET_ADMIN
36+
db:
37+
image: 'codeenigma/drupal8-db:latest'
38+
environment:
39+
MYSQL_ROOT_PASSWORD: ce-dev
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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/ce-dev-1.x:latest
15+
expose:
16+
- 443
17+
- 80
18+
x-ce_dev:
19+
host_aliases:
20+
- www.{{ project_name }}.local
21+
# Uncomment and comment the "volumes" below to use Unison file sync.
22+
# unison:
23+
# - src: ../
24+
# dest: /home/ce-dev/deploy/live.local
25+
# target_platforms:
26+
# - darwin
27+
# - linux
28+
# ignore:
29+
# - Name vendor
30+
# - Name node_modules
31+
# - Path */sites/*/files
32+
volumes:
33+
- ../:/home/ce-dev/deploy/live.local:delegated
34+
cap_add:
35+
- NET_ADMIN
36+
db:
37+
image: mariadb
38+
environment:
39+
MYSQL_ROOT_PASSWORD: ce-dev

templates/localgov/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
vendor
2+
node_modules

0 commit comments

Comments
 (0)