mirror of
https://github.com/overleaf/toolkit.git
synced 2025-04-19 15:28:06 +02:00
Add config checks to doctor and up scripts
This commit is contained in:
parent
95e3ad9ab9
commit
95fb90b79c
3 changed files with 33 additions and 0 deletions
23
bin/doctor
23
bin/doctor
|
@ -115,6 +115,28 @@ function print_warnings() {
|
|||
fi
|
||||
}
|
||||
|
||||
function check_config_files() {
|
||||
print_section_separator "Configuration"
|
||||
|
||||
docker_compose_file="config/docker-compose.yml"
|
||||
print_sub_point "$docker_compose_file"
|
||||
if [[ ! -f "$docker_compose_file" ]]; then
|
||||
print_sub_sub_point "status: MISSING !"
|
||||
add_warning "configuration file $docker_compose_file not found"
|
||||
else
|
||||
print_sub_sub_point "status: present"
|
||||
fi
|
||||
|
||||
local_conf_file="config/local.yml"
|
||||
print_sub_point "$local_conf_file"
|
||||
if [[ ! -f "$local_conf_file" ]]; then
|
||||
print_sub_sub_point "status: MISSING !"
|
||||
add_warning "configuration file $local_conf_file not found"
|
||||
else
|
||||
print_sub_sub_point "status: present"
|
||||
fi
|
||||
}
|
||||
|
||||
function cleanup() {
|
||||
rm "$WARNINGS_FILE"
|
||||
}
|
||||
|
@ -124,6 +146,7 @@ function __main__() {
|
|||
check_host_information
|
||||
check_dependencies
|
||||
check_docker_daemon
|
||||
check_config_files
|
||||
print_warnings
|
||||
print_section_separator "End"
|
||||
cleanup
|
||||
|
|
2
bin/init
2
bin/init
|
@ -9,6 +9,8 @@ function set_up_config_files() {
|
|||
}
|
||||
|
||||
function __main__() {
|
||||
# TODO:
|
||||
# - check if the user wants to overwrite existing config
|
||||
set_up_config_files
|
||||
}
|
||||
|
||||
|
|
8
bin/up
8
bin/up
|
@ -2,7 +2,15 @@
|
|||
|
||||
set -euo pipefail
|
||||
|
||||
function check_config() {
|
||||
if [[ ! -f config/docker-compose.yml ]] || [[ ! -f config/local.yml ]]; then
|
||||
echo "Config files not found! exiting"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function __main__() {
|
||||
check_config
|
||||
exec ./bin/docker-compose up
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue