Refactor templating and drupal 9 support
This commit is contained in:
parent
eabf4a2ec4
commit
f22e658183
16 changed files with 275 additions and 144 deletions
|
|
@ -125,4 +125,11 @@ if ! is_valid_number "$PASSWORD_LENGTH"; then
|
|||
exit 1;
|
||||
fi
|
||||
|
||||
# The 'PUBLIC_PORT' must be a valid number.
|
||||
if ! is_valid_number "$PUBLIC_PORT"; then
|
||||
log_error "Variable 'PUBLIC_PORT' is missing or not a valid number. ";
|
||||
log_info "Please verify that it is set correctly in '.env'. ";
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
log_ok "Read and validated configuration file. "
|
||||
|
|
@ -62,6 +62,7 @@ GRAPHDB_REPO="${GRAPHDB_REPO_PREFIX}${USERNAME_BASE}"
|
|||
BASE_DIR="$DRUPAL_ROOT/$INSTANCE_DOMAIN"
|
||||
COMPOSER_DIR="$BASE_DIR/project"
|
||||
WEB_DIR="$COMPOSER_DIR/web"
|
||||
ONTOLOGY_DIR="$WEB_DIR/sites/default/files/ontology"
|
||||
|
||||
# Setup aliases for drush and composer.
|
||||
alias composer="sudo -u $SYSTEM_USER /usr/local/bin/composer"
|
||||
|
|
|
|||
34
factory/lib/30_templates.sh
Normal file
34
factory/lib/30_templates.sh
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# This is a library file.
|
||||
# It should be 'source'd only, if it is not we bail out here.
|
||||
if [[ "$0" = "$BASH_SOURCE" ]]; then
|
||||
echo "This file should not be executed directly, it should be 'source'd only. "
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
TEMPLATE_DIR="$SCRIPT_DIR/resources/templates/"
|
||||
|
||||
# load_template will load a template $1 from the template directory
|
||||
# and replace ${$2} with $3, ${$4} with $5 etc.
|
||||
# echoes out the replaced template
|
||||
function load_template() {
|
||||
# read the template then remove the argument
|
||||
TEMPLATE=`cat "$TEMPLATE_DIR/$1"`
|
||||
shift 1;
|
||||
|
||||
# while we have a variable to substiute
|
||||
while [ ! -z "$1" ]
|
||||
do
|
||||
# do the substitution
|
||||
TEMPLATE="${TEMPLATE//\$\{$1\}/$2}"
|
||||
shift 2
|
||||
done;
|
||||
|
||||
# finally echo out the template
|
||||
echo "$TEMPLATE"
|
||||
}
|
||||
|
||||
# path where common apache files will be installed.
|
||||
WISSKI_COMMON_PATH="/etc/apache2/conf/wisski"
|
||||
|
|
@ -17,4 +17,5 @@ LIB_DIR="$SCRIPT_DIR/lib"
|
|||
source "$LIB_DIR/00_init.sh";
|
||||
source "$LIB_DIR/10_config.sh";
|
||||
source "$LIB_DIR/20_slug.sh";
|
||||
source "$LIB_DIR/30_utils.sh";
|
||||
source "$LIB_DIR/30_templates.sh";
|
||||
source "$LIB_DIR/40_utils.sh";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue