Add 'self' stack

This commit adds a new stack 'self' that for now just redirects to the
repository.
This commit is contained in:
Tom Wiesing 2020-07-02 11:26:32 +02:00
parent 653445225e
commit 56a44f8db3
No known key found for this signature in database
GPG key ID: DC1F29F2BC78AB15
10 changed files with 69 additions and 7 deletions

View file

@ -152,6 +152,7 @@ fi
# paths to composer things
DEPLOY_WEB_DIR="$DEPLOY_ROOT/core/web"
DEPLOY_SELF_DIR="$DEPLOY_ROOT/core/self"
DEPLOY_TRIPLESTORE_DIR="$DEPLOY_ROOT/core/triplestore"
DEPLOY_SQL_DIR="$DEPLOY_ROOT/core/sql"
DEPLOY_INSTANCES_DIR="$DEPLOY_ROOT/instances"

View file

@ -80,7 +80,7 @@ sql_bookkeep_insert \
"\"${SLUG}\",\"${INSTANCE_BASE_DIR}\",\"${MYSQL_DATABASE}\",\"${MYSQL_USER}\",\"${MYSQL_PASSWORD}\",\"${GRAPHDB_REPO}\",\"${GRAPHDB_USER}\",\"${GRAPHDB_PASSWORD}\""
log_info " => Writing configuration file"
load_template "runtime-config/environment" \
load_template "docker-env/runtime" \
"REAL_PATH" "${INSTANCE_DATA_DIR}" \
"VIRTUAL_HOST" "${INSTANCE_DOMAIN}" \
"LETSENCRYPT_HOST" "${LETSENCRYPT_HOST}" \

View file

@ -1,17 +1,16 @@
#######################
# Meta Settings
#######################
# Real path for volumes to be stored
REAL_PATH=${REAL_PATH}
# The target path to redirect to
TARGET=https://gitlab.cs.fau.de/AGFD/wisski-distillery
#######################
### Web Server settings
#######################
# the hostname for the website
VIRTUAL_HOST=${VIRTUAL_HOST}
VIRTUAL_HOST=example.com
# optional letsencrypt support
# when blank, ignore
LETSENCRYPT_HOST=${LETSENCRYPT_HOST}
LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}
LETSENCRYPT_HOST=
LETSENCRYPT_EMAIL=

View file

@ -0,0 +1,22 @@
version: "3.7"
services:
tr:
image: tkw01536/tr
restart: always
environment:
# port and hostname for this image to use
VIRTUAL_HOST: ${VIRTUAL_HOST}
VIRTUAL_PORT: 8080
# optional letsencrypt email
LETSENCRYPT_HOST: ${LETSENCRYPT_HOST}
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
# where to redirect to
TARGET: ${TARGET}
networks:
default:
external:
name: distillery

View file

@ -3,6 +3,8 @@ version: "3.7"
services:
nginx-proxy:
image: nginxproxy/nginx-proxy:alpine
environment:
- DEFAULT_HOST=${DEFAULT_HOST}
ports:
- "80:80"
- "443:443"

View file

@ -0,0 +1,6 @@
REAL_PATH=${REAL_PATH}
VIRTUAL_HOST=${VIRTUAL_HOST}
LETSENCRYPT_HOST=${LETSENCRYPT_HOST}
LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}

View file

@ -0,0 +1,6 @@
VIRTUAL_HOST=${VIRTUAL_HOST}
LETSENCRYPT_HOST=${LETSENCRYPT_HOST}
LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}
TARGET=https://gitlab.cs.fau.de/AGFD/wisski-distillery

View file

@ -0,0 +1 @@
DEFAULT_HOST=${DEFAULT_HOST}

View file

@ -48,6 +48,7 @@ pip3 install --upgrade docker-compose
log_info "=> Creating docker-compose directories"
mkdir -p "$DEPLOY_INSTANCES_DIR"
mkdir -p "$DEPLOY_WEB_DIR"
mkdir -p "$DEPLOY_SELF_DIR"
mkdir -p "$DEPLOY_TRIPLESTORE_DIR"
mkdir -p "$DEPLOY_SQL_DIR"
@ -57,6 +58,27 @@ docker network create distillery || true
log_info "=> Creating 'docker-compose' files for the 'web'. "
install_resource_dir "compose/web" "$DEPLOY_WEB_DIR"
log_info " => Writing 'web' configuration file"
load_template "docker-env/web" \
"DEFAULT_HOST" "${DEFAULT_DOMAIN}" \
> "$DEPLOY_WEB_DIR/.env"
log_info "=> Creating 'docker-compose' files for the 'self'. "
install_resource_dir "compose/self" "$DEPLOY_SELF_DIR"
# setup the lesencrypt host for the default domain
if [ -n "$LETSENCRYPT_HOST" ]; then
LETSENCRYPT_HOST="$DEFAULT_DOMAIN"
fi;
log_info " => Writing 'self' configuration file"
load_template "docker-env/self" \
"VIRTUAL_HOST" "${DEFAULT_DOMAIN}" \
"LETSENCRYPT_HOST" "${LETSENCRYPT_HOST}" \
"LETSENCRYPT_EMAIL" "${LETSENCRYPT_EMAIL}" \
> "$DEPLOY_SELF_DIR/.env"
# copy over the directory
log_info "=> Creating 'docker-compose' files for the 'triplestore'. "
install_resource_dir "compose/triplestore" "$DEPLOY_TRIPLESTORE_DIR"

View file

@ -17,6 +17,9 @@ function update_stack() {
log_info "=> Rebuilding and restarting 'web' stack"
update_stack "$DEPLOY_WEB_DIR"
log_info "=> Rebuilding and restarting 'self' stack"
update_stack "$DEPLOY_SELF_DIR"
# build and start the triplestore
log_info "=> Rebuilding and restarting 'triplestore' stack"
update_stack "$DEPLOY_TRIPLESTORE_DIR"