Add a resolver

This commit adds a resolver to the toplevel Distillery domain, to allow
resolving domains globally.
This commit is contained in:
Tom Wiesing 2022-07-27 11:17:38 +02:00
parent eee3d95351
commit 45ee6b665e
No known key found for this signature in database
11 changed files with 129 additions and 7 deletions

View file

@ -0,0 +1,31 @@
#!/bin/bash
set -e
# read the lib/shared.sh
DISABLE_LOG=1
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$DIR"
source "$DIR/lib/lib.sh"
DISABLE_LOG=0
log_info " => Writing prefix configuration"
echo -n "# Prefix configuration, last updated on" | tee "$DEPLOY_PREFIX_CONFIG"
date | tee -a "$DEPLOY_PREFIX_CONFIG"
# update all the instances
for slug in $(sql_bookkeep_list); do
INSTANCE_DOMAIN="$(compute_instance_domain "$slug")"
echo "$INSTANCE_DOMAIN:" | tee -a "$DEPLOY_PREFIX_CONFIG"
read -r INSTANCE_BASE_DIR MYSQL_DATABASE MYSQL_USER GRAPHDB_REPO GRAPHDB_USER GRAPHDB_PASSWORD <<< "$(sql_bookkeep_load "${slug}" "filesystem_base,sql_database,sql_user,graphdb_repository,graphdb_user,graphdb_password" | tail -n +2)"
pushd "$INSTANCE_BASE_DIR" > /dev/null
docker-compose exec barrel /user_shell.sh -c "drush php:script /wisskiutils/list_uri_prefixes.php" | tee -a "$DEPLOY_PREFIX_CONFIG"
popd > /dev/null
done
log_info " => Restarting resolver"
cd "$DEPLOY_RESOLVER_DIR"
docker-compose restart