Fix exit log on self-hosted

This commit is contained in:
Shivam Mathur 2020-06-07 02:41:28 +05:30
parent 7cec1987ac
commit c09954033f
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
3 changed files with 16 additions and 13 deletions

View File

@ -26,10 +26,6 @@ read_env() {
# Function to setup environment for self-hosted runners.
self_hosted_setup() {
if [[ "$version" =~ $old_versions ]]; then
add_log "$cross" "PHP" "PHP $version is not supported on self-hosted runner"
exit 1
fi
if [[ $(command -v brew) == "" ]]; then
step_log "Setup Brew"
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh | bash -s >/dev/null 2>&1
@ -238,8 +234,13 @@ existing_version=$(php-config --version 2>/dev/null | cut -c 1-3)
read_env
if [ "$runner" = "self-hosted" ]; then
if [[ "$version" =~ $old_versions ]]; then
add_log "$cross" "PHP" "PHP $version is not supported on self-hosted runner"
exit 1
else
self_hosted_setup >/dev/null 2>&1
fi
fi
# Setup PHP
step_log "Setup PHP"

View File

@ -34,10 +34,6 @@ update_lists() {
# Function to setup environment for self-hosted runners.
self_hosted_setup() {
if [[ "$version" =~ $old_versions ]]; then
add_log "$cross" "PHP" "PHP $version is not supported on self-hosted runner"
exit 1
fi
echo "Set disable_coredump false" | sudo tee -a /etc/sudo.conf
if ! command -v apt-fast >/dev/null; then
sudo ln -sf /usr/bin/apt-get /usr/bin/apt-fast
@ -367,12 +363,18 @@ apt_install="sudo $debconf_fix apt-fast install -y"
tool_path_dir="/usr/local/bin"
existing_version=$(php-config --version 2>/dev/null | cut -c 1-3)
# Setup PHP
step_log "Setup PHP"
read_env
if [ "$runner" = "self-hosted" ]; then
if [[ "$version" =~ $old_versions ]]; then
add_log "$cross" "PHP" "PHP $version is not supported on self-hosted runner"
exit 1
else
self_hosted_setup >/dev/null 2>&1
fi
fi
# Setup PHP
step_log "Setup PHP"
sudo mkdir -p /var/run /run/php
if [ "$existing_version" != "$version" ]; then
if [ ! -e "/usr/bin/php$version" ]; then

View File

@ -308,7 +308,7 @@ if($env:RUNNER -eq 'self-hosted') {
}
if($version -lt 5.6) {
Add-Log $cross "PHP" "PHP $version is not supported on self-hosted runner"
Start-Sleep 3
Start-Sleep 1
exit 1
}
if ((Get-InstalledModule).Name -notcontains 'VcRedist') {