fork 0k-charms
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

23 lines
506 B

#!/bin/bash
set -e
NEXTCLOUD_APP_CONNECTION_DIR="$state_tmpdir/$PROJECT_NAME/$SERVICE_NAME/"
mkdir -p "$NEXTCLOUD_APP_CONNECTION_DIR"
# Atomicity
i=1
while ! mkdir "$NEXTCLOUD_APP_CONNECTION_DIR"/"$i"; do ((i++)) ; done
if ! nextcloud_url=$(relation:get "$MASTER_TARGET_SERVICE_NAME":web-proxy url) || [ -z "$nextcloud_url" ]; then
nextcloud_url="http://$TARGET_SERVICE_NAME:80"
fi
config-add "\
services:
$MASTER_BASE_SERVICE_NAME:
environment:
aliasgroup$i: \"${nextcloud_url}\"
"