Skip to content

Commit

Permalink
Check PHP dependencies in daily.sh (librenms#12260)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jellyfrog authored Oct 29, 2020
1 parent 4746c3f commit d82d2f1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
16 changes: 15 additions & 1 deletion daily.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ status_run() {
else
printf " \033[0;31mFAIL\033[0m\n";
if [[ "${arg_option}" == "update" ]]; then
php "${LIBRENMS_DIR}/daily.php" -f notify -o "${tmp}"
php "${LIBRENMS_DIR}/daily.php" -f notify -o "${tmp}" > /dev/null 2>&1
fi
if [[ ! -z "${tmp}" ]]; then
# print output in case of failure
Expand Down Expand Up @@ -126,6 +126,9 @@ set_notifiable_result() {
# Exit-Code: 0 >= min ver, 1 < min ver
#######################################
check_dependencies() {
# Check first, no point in continuing otherwise.
php_dependencies

local branch=$(git rev-parse --abbrev-ref HEAD)
scripts/check_requirements.py > /dev/null 2>&1 || pip3 install -r requirements.txt > /dev/null 2>&1

Expand Down Expand Up @@ -178,6 +181,17 @@ check_dependencies() {
return 1;
}

#######################################
# The check-platform-reqs command checks that your PHP and extensions versions match the platform requirements of the installed packages
#
# Returns:
# Exits on error
#######################################
php_dependencies() {
status_run 'Checking PHP dependencies' "${COMPOSER} check-platform-reqs --no-dev --no-cache" 'update' || exit 1
return 0
}

#######################################
# Compare two numeric versions
# Arguments:
Expand Down
3 changes: 2 additions & 1 deletion scripts/composer_wrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@
}

if ($exec) {
passthru("$exec " . implode(' ', array_splice($argv, 1)) . "$extra_args 2>&1");
passthru("$exec " . implode(' ', array_splice($argv, 1)) . "$extra_args 2>&1", $exit_code);
exit($exit_code);
} else {
echo "Composer not available, please manually install composer.\n";
}
Expand Down

0 comments on commit d82d2f1

Please sign in to comment.