From 4942f7fbd4c24ef96c13c22ab966ead8d7ae322d Mon Sep 17 00:00:00 2001 From: Christian Winther Date: Sun, 10 Mar 2024 15:13:45 +0000 Subject: [PATCH] docker: docs --- docker/check-requirements | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/docker/check-requirements b/docker/check-requirements index 2a7c2a478..6f283711f 100755 --- a/docker/check-requirements +++ b/docker/check-requirements @@ -91,29 +91,46 @@ echo -e "This script will check your system for the minimum requirements outline echo -e "You can find the guide here ${BLUE}https://jippi.github.io/pixelfed-docs-next/pr-preview/pr-1/running-pixelfed/docker/prerequisites.html#software${GREEN}." echo -e "${NO_COLOR}" +# git installed? action_start "Checking if [$(highlight "git")] command is available" -command -v git >/dev/null 2>&1 || { action_error_exit "I require the 'git' command, but it's not installed"; } +command -v git >/dev/null 2>&1 || { + action_error_exit "I require the 'git' command, but it's not installed" +} action_ok "git is installed" +# docker installed? action_start "Checking if [$(highlight "docker")] command is available" -command -v docker >/dev/null 2>&1 || { action_error_exit "I require the 'docker' command, but it's not installed. ${DOCKER_HELP}"; } +command -v docker >/dev/null 2>&1 || { + action_error_exit "I require the 'docker' command, but it's not installed. ${DOCKER_HELP}" +} action_ok "docker is installed" +# docker compose installed? action_start "Checking if [$(highlight "docker compose")] command is available" -docker compose >/dev/null 2>&1 || { action_error_exit "I require the 'docker compose' command, but it's not installed. ${DOCKER_HELP}"; } +docker compose >/dev/null 2>&1 || { + action_error_exit "I require the 'docker compose' command, but it's not installed. ${DOCKER_HELP}" +} action_ok "docker compose is installed" +# docker compose version is acceptable? compose_version=$(docker compose version --short) declare -a compose_version_arr IFS="." read -r -a compose_version_arr <<<"$compose_version" +## major version action_start "Checking if [$(highlight "docker compose version")] major version (${min_docker_compose_version_arr[0]}) is acceptable" -[[ ${compose_version_arr[0]} -eq ${min_docker_compose_version_arr[0]} ]] || { action_error_exit "I require minimum Docker Compose major version ${min_docker_compose_version_arr[0]}.x.x - found ${compose_version}.${DOCKER_HELP}"; } +[[ ${compose_version_arr[0]} -eq ${min_docker_compose_version_arr[0]} ]] || { + action_error_exit "I require minimum Docker Compose major version ${min_docker_compose_version_arr[0]}.x.x - found ${compose_version}.${DOCKER_HELP}" +} action_ok "You're using major version ${compose_version_arr[0]}" +## minor version action_start "Checking if [$(highlight "docker compose version")] minor version (${min_docker_compose_version_arr[1]}) is acceptable" -[[ ${compose_version_arr[1]} -ge ${min_docker_compose_version_arr[1]} ]] || { action_error_exit "I require minimum Docker Compose minor version ${min_docker_compose_version_arr[0]}.${min_docker_compose_version_arr[1]} - found ${compose_version}.${DOCKER_HELP}"; } +[[ ${compose_version_arr[1]} -ge ${min_docker_compose_version_arr[1]} ]] || { + action_error_exit "I require minimum Docker Compose minor version ${min_docker_compose_version_arr[0]}.${min_docker_compose_version_arr[1]} - found ${compose_version}.${DOCKER_HELP}" +} action_ok "You're using minor version ${compose_version_arr[1]}" +# Yay, everything is fine echo -e "🎉 ${GREEN}All checks passed, you should be ready to run Pixelfed on this server!${NO_COLOR}"