Commit b6a5ce52 authored by Alain Takoudjou's avatar Alain Takoudjou Committed by Alain Takoudjou

Update drupal configuration, add parameter json schema

parent b30122ef
[template-drupal-instance]
filename = drupal-instance.cfg.in
md5sum = 93e5694836b85ef82de4e90a07c5127d
md5sum = 09a421327c11d4715a61516607c9de85
[template-settings.php]
filename = default.settings.php.in
md5sum = ef6369e834d774dfaeedc993d70aa98f
[template-settings.local.php]
filename = settings.local.php.in
md5sum = 2692b85c568694c618255095ecea11c5
<?php
// phpcs:ignoreFile
$databases = [];
$settings['update_free_access'] = FALSE;
# $settings['file_public_base_url'] = 'http://downloads.example.com/files';
# $settings['file_public_path'] = 'sites/default/files';
$settings['file_temp_path'] = '{{ parameter_dict['tmp-dir'] }}';
/**
* Load services definition file.
*/
$settings['container_yamls'][] = $app_root . '/' . $site_path . '/services.yml';
$settings['file_scan_ignore_directories'] = [
'node_modules',
'bower_components',
];
$settings['entity_update_batch_size'] = 50;
$settings['entity_update_backup'] = TRUE;
$settings['migrate_node_migrate_type_classic'] = FALSE;
/**
* Load local development override configuration, if available.
*
* Create a settings.local.php file to override variables on secondary (staging,
* development, etc.) installations of this site.
*
* Keep this code block at the end of this file to take full effect.
*/
if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) {
include $app_root . '/' . $site_path . '/settings.local.php';
}
......@@ -2,6 +2,21 @@
enable-php8 = !py!True
document-root = ${:default-document-root}/docroot
[template-base]
recipe = slapos.recipe.template:jinja2
context =
section parameter_dict instance-parameter
[settings.php]
<= template-base
url = {{ template_settings_php }}
output = ${directory:www}/docroot/sites/settings.base.php
[settings.local.php]
<= template-base
url = {{ template_settings_local }}
output = ${directory:www}/docroot/sites/settings.local.php
[drush-bin]
recipe = slapos.cookbook:wrapper
command-line =
......@@ -20,7 +35,7 @@ input = inline:
export ACCOUNT_MAIL=${instance-parameter:account-mail}
export ACCOUNT_PASS=${drupal-admin-passwd:passwd}
export PATH={{ mariadb_location }}/bin:$PATH
output = ${directory:etc}/site.env
output = ${directory:etc}/.site.env
mode = 600
[drupal-site-install]
......@@ -29,29 +44,46 @@ recipe = collective.recipe.template
input = inline:#!/bin/sh
set -e
CONFIG_FILE=${directory:www}/docroot/sites/default/settings.php
INSTALL_FILE=${directory:var}/.install-done
if [ -s "$INSTALL_FILE" ]; then
echo "Drupal is installed."
exit 0;
fi
. ${drupal-env:output}
if [ ! -s "$CONFIG_FILE" ]; then
cp ${settings.php:output} $CONFIG_FILE
fi
${drush-bin:wrapper-path} site:install $DRUPAL_PROFILE \
--locale=$LOCALE \
--db-url=$DB_URL \
--site-name=$SITE_NAME \
--site-name="$SITE_NAME" \
--site-mail=$SITE_MAIL \
--account-name=$ACCOUNT_NAME \
--account-name="$ACCOUNT_NAME" \
--account-mail=$ACCOUNT_MAIL \
--account-pass=$ACCOUNT_PASS \
--verbose --yes
# Rebuild all caches.
${drush-bin:wrapper-path} cache:rebuild
echo "done" > $INSTALL_FILE
chmod 440 $INSTALL_FILE
mode = 744
depends =
${settings.php:recipe}
${settings.local.php:recipe}
[drupal-admin-passwd]
recipe = slapos.cookbook:generate.password
storage-path = ${directory:etc}/.admin_pwd
[instance-parameter]
tmp-dir = ${directory:tmp}
trusted-host-list =
\[${apache-php-configuration:ip}\]
${request-frontend:connection-domain}
${slap-parameter:instance.trusted-host}
site-profile = ${slap-parameter:instance.site-profile}
site-locale = ${slap-parameter:instance.site-locate}
site-name = ${slap-parameter:instance.site-name}
......@@ -59,6 +91,10 @@ site-mail = ${slap-parameter:instance.site-mail}
account-name = ${slap-parameter:instance.account-name}
account-mail = ${slap-parameter:instance.account-mail}
[publish-connection-information]
admin-username = ${instance-parameter:account-name}
admin-password = ${drupal-admin-passwd:passwd}
[slap-parameter]
instance.site-profile = standard
instance.site-locate = fr
......@@ -66,3 +102,4 @@ instance.site-name = Drupal SlapOS
instance.site-mail = admin@example.com
instance.account-name = admin
instance.account-mail = admin@example.com
instance.trusted-host =
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Parameters to instantiate NextCloud",
"type": "object",
"additionalProperties": false,
"properties": {
"apache-computer-guid": {
"title": "Computer ID for Apache Instance.",
"description": "Unique identifier of the computer, like \"COMP-1234\". By default, let Master choose a computer.",
"type": "string"
},
"mariadb-computer-guid": {
"title": "Computer ID for Mariadb Instance.",
"description": "Unique identifier of the computer, like \"COMP-1234\". By default, let Master choose a computer.",
"type": "string"
},
"instance.site-name": {
"title": "Site Name",
"description": "Drupal site name",
"type": "string"
},
"instance.site-mail": {
"title": "Site Mail",
"description": "Site email address",
"type": "string"
},
"instance.account-mail": {
"title": "Admin Mail",
"description": "Admin email address",
"type": "string"
},
"instance.account-name": {
"title": "Admin username",
"description": "Admin username.",
"type": "string"
}
}
}
<?php
# Warning: This file will be modified by SlapOS!
$settings['trusted_host_patterns'] = [
{% for host in parameter_dict['trusted-host-list'].split('\n') -%}
{% if host.strip() -%}
{{ "'^" ~ host.strip().replace('.', '\.') ~ "$'," }}
{% endif -%}
{% endfor -%}
];
[buildout]
extends =
../../component/redis/buildout.cfg
../../component/nodejs/buildout.cfg
../../component/python-2.7/buildout.cfg
../../component/pytest/buildout.cfg
../../component/java-jdk/buildout.cfg
../../stack/lamp/buildout.cfg
buildout.hash.cfg
......@@ -31,7 +29,6 @@ path = ${template-drupal-instance:output}
part-list = drupal-site-install
db-name = drupal_db
db-user = drupal
#default-frontend = False
[composer]
recipe = slapos.recipe.build:download
......@@ -39,7 +36,7 @@ url = https://getcomposer.org/installer
filename = composer-setup.php
[composer-php.ini]
# A minimal php.ini that will be used to install druplal
# A minimal php.ini that will be used for composer
recipe = collective.recipe.template
input =
inline:[PHP]
......@@ -92,7 +89,7 @@ branch = master
[install-drupal]
recipe = slapos.recipe.cmmi
path = ${application:location}
configure-command = true
configure-command =true
# ${composer-bin:output} config vendor-dir docroot/vendor
make-targets =
make-options =
......@@ -113,6 +110,14 @@ context =
key php_location apache-php:location
key mariadb_location mariadb:location
key nodejs_location nodejs:location
key template_settings_php template-settings.php:target
key template_settings_local template-settings.local.php:target
[template-settings.php]
<= drupal-download
[template-settings.local.php]
<= drupal-download
[template]
recipe =
......
{
"name": "Drupal",
"description": "Drupal Software Release",
"serialisation": "xml",
"software-type": {
"default": {
"title": "Default",
"description": "Drupal",
"request": "instance-drupal-input-schema.json",
"response": "instance-drupal-output-schema.json",
"index": 0
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment