diff --git a/distillery/lib/30_slug.sh b/distillery/lib/30_slug.sh index 31bb1fe..8c6341d 100644 --- a/distillery/lib/30_slug.sh +++ b/distillery/lib/30_slug.sh @@ -43,6 +43,16 @@ function compute_instance_domain() { } INSTANCE_DOMAIN="$(compute_instance_domain "$SLUG")" +# compute the url pointing to an instance +function compute_instance_url() { + if [ -n "$CERTBOT_EMAIL" ]; then + echo -n "https://" + else + echo "http://" + fi + compute_instance_domain "$@" +} + # Next we need a username base. # This will be used as a username across the system (linux), MySQL and GraphDB. # For this we can only allow [0-9a-zA-Z-], hence we have to escape. diff --git a/distillery/update_prefix_config.sh b/distillery/update_prefix_config.sh index 20f059b..f73da21 100644 --- a/distillery/update_prefix_config.sh +++ b/distillery/update_prefix_config.sh @@ -15,7 +15,7 @@ date | tee -a "$DEPLOY_PREFIX_CONFIG" # update all the instances for slug in $(sql_bookkeep_list); do - INSTANCE_DOMAIN="http://$(compute_instance_domain "$slug")" + INSTANCE_DOMAIN="$(compute_instance_url "$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)"