mirror of
https://github.com/overleaf/toolkit.git
synced 2025-04-19 15:28:06 +02:00
Moved prefix brand checs from bin/up to bin/docker-compose
This commit is contained in:
parent
f5f7ddde89
commit
026bdb7bf0
2 changed files with 34 additions and 34 deletions
|
@ -18,6 +18,39 @@ fi
|
|||
|
||||
source "$TOOLKIT_ROOT/lib/shared-functions.sh"
|
||||
|
||||
function check_sharelatex_env_vars() {
|
||||
set +o pipefail
|
||||
local rc_occurrences=$(grep -o SHARELATEX_ "$TOOLKIT_ROOT/config/overleaf.rc" | wc -l | sed 's/ //g')
|
||||
set -o pipefail
|
||||
|
||||
if [ "$rc_occurrences" -gt 0 ]; then
|
||||
echo "WARNING: some runtime variables defined in config/overleaf.rc"
|
||||
echo "contain 'SHARELATEX_' in their name. The variables should be"
|
||||
echo "renamed to 'OVERLEAF_'."
|
||||
echo "you can upgrade your config/overleaf.rc by running bin/rename-rc-vars"
|
||||
prompt "Do you want to continue?"
|
||||
fi
|
||||
|
||||
local invalid_prefix="SHARELATEX_"
|
||||
if [[ "$IMAGE_VERSION_MAJOR" -lt 5 ]]; then
|
||||
invalid_prefix="OVERLEAF_"
|
||||
fi
|
||||
|
||||
set +o pipefail
|
||||
local env_occurrences=$(grep -o "$invalid_prefix" "$TOOLKIT_ROOT/config/variables.env" | wc -l | sed 's/ //g')
|
||||
set -o pipefail
|
||||
|
||||
if [ "$env_occurrences" -gt 0 ]; then
|
||||
echo "WARNING: some environment variables defined in config/variables.env"
|
||||
echo "contain '$invalid_prefix' in their name"
|
||||
echo "Starting with Overleaf CE and Server Pro 5.0.0 the environment variables"
|
||||
echo "use the prefix 'OVERLEAF_' instead of 'SHARELATEX_'."
|
||||
echo "Please check your config/version, and config/variables.env files,"
|
||||
echo "you can upgrade your config/variables.env to use 'OVERLEAF_' by running bin/rename-env-vars-5-0"
|
||||
prompt "Do you want to continue?"
|
||||
fi
|
||||
}
|
||||
|
||||
function build_environment() {
|
||||
canonicalize_data_paths
|
||||
set_base_vars
|
||||
|
@ -209,6 +242,7 @@ function docker_compose() {
|
|||
|
||||
read_image_version
|
||||
read_config
|
||||
check_sharelatex_env_vars
|
||||
build_environment
|
||||
print_debug_info "$@"
|
||||
docker_compose "$@"
|
||||
|
|
34
bin/up
34
bin/up
|
@ -35,39 +35,6 @@ function check_config() {
|
|||
fi
|
||||
}
|
||||
|
||||
function check_sharelatex_env_vars() {
|
||||
set +o pipefail
|
||||
local rc_occurrences=$(grep -o SHARELATEX_ "$TOOLKIT_ROOT/config/overleaf.rc" | wc -l | sed 's/ //g')
|
||||
set -o pipefail
|
||||
|
||||
if [ "$rc_occurrences" -gt 0 ]; then
|
||||
echo "WARNING: some runtime variables defined in config/overleaf.rc"
|
||||
echo "contain 'SHARELATEX_' in their name. The variables should be"
|
||||
echo "renamed to 'OVERLEAF_'."
|
||||
echo "you can upgrade your config/overleaf.rc by running bin/rename-rc-vars"
|
||||
prompt "Do you want to continue?"
|
||||
fi
|
||||
|
||||
local invalid_prefix="SHARELATEX_"
|
||||
if [[ "$IMAGE_VERSION_MAJOR" -lt 5 ]]; then
|
||||
invalid_prefix="OVERLEAF_"
|
||||
fi
|
||||
|
||||
set +o pipefail
|
||||
local env_occurrences=$(grep -o "$invalid_prefix" "$TOOLKIT_ROOT/config/variables.env" | wc -l | sed 's/ //g')
|
||||
set -o pipefail
|
||||
|
||||
if [ "$env_occurrences" -gt 0 ]; then
|
||||
echo "WARNING: some environment variables defined in config/variables.env"
|
||||
echo "contain '$invalid_prefix' in their name"
|
||||
echo "Starting with Overleaf CE and Server Pro 5.0.0 the environment variables"
|
||||
echo "use the prefix 'OVERLEAF_' instead of 'SHARELATEX_'."
|
||||
echo "Please check your config/version, and config/variables.env files,"
|
||||
echo "you can upgrade your config/variables.env to use 'OVERLEAF_' by running bin/rename-env-vars-5-0"
|
||||
prompt "Do you want to continue?"
|
||||
fi
|
||||
}
|
||||
|
||||
function initiate_mongo_replica_set() {
|
||||
echo "Initiating Mongo replica set..."
|
||||
"$TOOLKIT_ROOT/bin/docker-compose" up -d mongo
|
||||
|
@ -87,7 +54,6 @@ function __main__() {
|
|||
|
||||
read_image_version
|
||||
check_config
|
||||
check_sharelatex_env_vars
|
||||
read_config
|
||||
|
||||
if [[ "$MONGO_ENABLED" == "true" && "$IMAGE_VERSION_MAJOR" -ge 4 ]]; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue