Skip to content

Commit

Permalink
Release v2-verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Mar 13, 2021
1 parent 0ce7328 commit 486262f
Show file tree
Hide file tree
Showing 28 changed files with 119 additions and 119 deletions.
6 changes: 3 additions & 3 deletions __tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ describe('Utils tests', () => {
});

it('checking suppressOutput', async () => {
expect(await utils.suppressOutput('win32')).toEqual(' >$null 2>&1');
expect(await utils.suppressOutput('linux')).toEqual(' >/dev/null 2>&1');
expect(await utils.suppressOutput('darwin')).toEqual(' >/dev/null 2>&1');
expect(await utils.suppressOutput('win32')).toEqual(' ');
expect(await utils.suppressOutput('linux')).toEqual(' ');
expect(await utils.suppressOutput('darwin')).toEqual(' ');
expect(await utils.suppressOutput('openbsd')).toContain(
'Platform openbsd is not supported'
);
Expand Down
6 changes: 3 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1585,7 +1585,7 @@ async function addINIValuesUnix(ini_values_csv) {
});
return ('echo "' +
ini_values.join('\n') +
'" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null 2>&1' +
'" | sudo tee -a "${pecl_file:-${ini_file[@]}}" ' +
script);
}
exports.addINIValuesUnix = addINIValuesUnix;
Expand Down Expand Up @@ -2909,10 +2909,10 @@ exports.getExtensionPrefix = getExtensionPrefix;
async function suppressOutput(os_version) {
switch (os_version) {
case 'win32':
return ' >$null 2>&1';
return ' ';
case 'linux':
case 'darwin':
return ' >/dev/null 2>&1';
return ' ';
default:
return await log('Platform ' + os_version + ' is not supported', os_version, 'error');
}
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function addINIValuesUnix(
return (
'echo "' +
ini_values.join('\n') +
'" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null 2>&1' +
'" | sudo tee -a "${pecl_file:-${ini_file[@]}}" ' +
script
);
}
Expand Down
20 changes: 10 additions & 10 deletions src/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ self_hosted_setup() {
add_log "$cross" "PHP" "PHP $version is not supported on self-hosted runner"
exit 1
else
self_hosted_helper >/dev/null 2>&1
self_hosted_helper
fi
fi
}
Expand Down Expand Up @@ -127,7 +127,7 @@ enable_cache_extension() {
# Function to enable existing extensions.
enable_extension() {
if [ -e /tmp/setup_php_dismod ] && grep -q "$1" /tmp/setup_php_dismod; then
sudo phpenmod -v "$version" "$1" >/dev/null 2>&1
sudo phpenmod -v "$version" "$1"
fi
if [ -d /tmp/extcache/"$1" ]; then
enable_cache_extension "$1" "$2"
Expand All @@ -149,13 +149,13 @@ configure_php() {
configure_pecl() {
if ! [ -e /tmp/pecl_config ]; then
if ! command -v pecl >/dev/null || ! command -v pear >/dev/null; then
add_pecl >/dev/null 2>&1
add_pecl
fi
for script in pear pecl; do
sudo "$script" config-set php_ini "${pecl_file:-${ini_file[@]}}"
sudo "$script" channel-update "$script".php.net
done
echo '' | sudo tee /tmp/pecl_config >/dev/null 2>&1
echo '' | sudo tee /tmp/pecl_config
fi
}

Expand All @@ -175,8 +175,8 @@ get_pecl_version() {
# Function to install PECL extensions and accept default options
pecl_install() {
local extension=$1
configure_pecl >/dev/null 2>&1
yes '' 2>/dev/null | sudo pecl install -f "$extension" >/dev/null 2>&1
configure_pecl
yes '' 2>/dev/null | sudo pecl install -f "$extension"
}

# Function to setup pre-release extensions using PECL.
Expand Down Expand Up @@ -215,7 +215,7 @@ configure_composer() {
exit 1
fi
if ! [ -e "$composer_json" ]; then
echo '{}' | tee "$composer_json" >/dev/null 2>&1
echo '{}' | tee "$composer_json"
sudo chmod 644 "$composer_json"
fi
composer -q config -g process-timeout 0
Expand Down Expand Up @@ -267,8 +267,8 @@ add_composertool() {
fi
fi
(
sudo rm -f "$composer_lock" >/dev/null 2>&1 || true
composer global require "$prefix$release" >/dev/null 2>&1
sudo rm -f "$composer_lock" || true
composer global require "$prefix$release"
json=$(grep "$prefix$tool" "$composer_json") &&
tool_version=$(get_tool_version 'echo' "$json") &&
add_log "$tick" "$tool" "Added $tool $tool_version"
Expand Down Expand Up @@ -309,6 +309,6 @@ add_extension_from_github() {
git submodule update --init --recursive || exit 1
phpize && ./configure && make -j"$(nproc)" && sudo make install
enable_extension "$extension" "$prefix"
) >/dev/null 2>&1
)
add_extension_log "$extension-$org/$repo@$release" "Installed and enabled"
}
24 changes: 12 additions & 12 deletions src/scripts/darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
self_hosted_helper() {
if ! command -v brew >/dev/null; then
step_log "Setup Brew"
get -q -e "/tmp/install.sh" "https://raw.githubusercontent.com/Homebrew/install/master/install.sh" && /tmp/install.sh >/dev/null 2>&1
get -q -e "/tmp/install.sh" "https://raw.githubusercontent.com/Homebrew/install/master/install.sh" && /tmp/install.sh
add_log "${tick:?}" "Brew" "Installed Homebrew"
fi
}
Expand All @@ -12,7 +12,7 @@ remove_extension() {
extension=$1
if check_extension "$extension"; then
sudo sed -Ei '' "/=(.*\/)?\"?$extension(.so)?$/d" "${ini_file:?}"
sudo rm -rf "${scan_dir:?}"/*"$extension"* "${ext_dir:?}"/"$extension".so >/dev/null 2>&1
sudo rm -rf "${scan_dir:?}"/*"$extension"* "${ext_dir:?}"/"$extension".so
(! check_extension "$extension" && add_log "${tick:?}" ":$extension" "Removed") ||
add_log "${cross:?}" ":$extension" "Could not remove $extension on PHP ${semver:?}"
else
Expand All @@ -33,7 +33,7 @@ add_pecl_extension() {
if [ "$ext_version" = "$pecl_version" ]; then
add_log "${tick:?}" "$extension" "Enabled"
else
remove_extension "$extension" >/dev/null 2>&1
remove_extension "$extension"
pecl_install "$extension-$pecl_version"
add_extension_log "$extension-$pecl_version" "Installed and enabled"
fi
Expand All @@ -56,11 +56,11 @@ add_brew_tap() {
tap=$1
if ! [ -d "$tap_dir/$tap" ]; then
if [ "${runner:?}" = "self-hosted" ]; then
brew tap --shallow "$tap" >/dev/null 2>&1
brew tap --shallow "$tap"
else
fetch_brew_tap "$tap" >/dev/null 2>&1
fetch_brew_tap "$tap"
if ! [ -d "$tap_dir/$tap" ]; then
brew tap --shallow "$tap" >/dev/null 2>&1
brew tap --shallow "$tap"
fi
fi
fi
Expand All @@ -78,7 +78,7 @@ add_brew_extension() {
add_brew_tap shivammathur/homebrew-php
add_brew_tap shivammathur/homebrew-extensions
sudo mv "$tap_dir"/shivammathur/homebrew-extensions/.github/deps/"$formula"/* "$tap_dir/homebrew/homebrew-core/Formula/" 2>/dev/null || true
brew install -f "$formula@$version" >/dev/null 2>&1
brew install -f "$formula@$version"
sudo cp "$brew_prefix/opt/$formula@$version/$extension.so" "$ext_dir"
add_extension_log "$extension" "Installed and enabled"
fi
Expand All @@ -92,8 +92,8 @@ add_extension() {
if check_extension "$extension"; then
add_log "${tick:?}" "$extension" "Enabled"
else
[[ "$version" =~ 5.[4-5] ]] && [ "$extension" = "imagick" ] && brew install -f pkg-config imagemagick >/dev/null 2>&1
pecl_install "$extension" >/dev/null 2>&1 &&
[[ "$version" =~ 5.[4-5] ]] && [ "$extension" = "imagick" ] && brew install -f pkg-config imagemagick
pecl_install "$extension" &&
if [[ "$version" =~ ${old_versions:?} ]]; then echo "$prefix=$ext_dir/$extension.so" >>"$ini_file"; fi
add_extension_log "$extension" "Installed and enabled"
fi
Expand Down Expand Up @@ -158,13 +158,13 @@ setup_php() {
step_log "Setup PHP"
existing_version=$(php-config --version 2>/dev/null | cut -c 1-3)
if [[ "$version" =~ ${old_versions:?} ]]; then
run_script "php5-darwin" "${version/./}" >/dev/null 2>&1
run_script "php5-darwin" "${version/./}"
status="Installed"
elif [ "$existing_version" != "$version" ]; then
add_php "install" >/dev/null 2>&1
add_php "install"
status="Installed"
elif [ "$existing_version" = "$version" ] && [ "${update:?}" = "true" ]; then
add_php "upgrade" >/dev/null 2>&1
add_php "upgrade"
status="Updated to"
else
status="Found"
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/ext/blackfire.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ add_blackfire() {
if [ "$extension_version" = "blackfire" ]; then
extension_version=$(get -s -n "" https://blackfire.io/api/v1/releases | grep -Eo 'php":"([0-9]+.[0-9]+.[0-9]+)' | cut -d '"' -f 3)
fi
get -q -n "${ext_dir:?}/blackfire.so" https://packages.blackfire.io/binaries/blackfire-php/"$extension_version"/blackfire-php-"$platform"_amd64-php-"$no_dot_version".so >/dev/null 2>&1
get -q -n "${ext_dir:?}/blackfire.so" https://packages.blackfire.io/binaries/blackfire-php/"$extension_version"/blackfire-php-"$platform"_amd64-php-"$no_dot_version".so
fi
echo "extension=blackfire.so" | sudo tee -a "$blackfire_ini_file" >/dev/null 2>&1
echo "extension=blackfire.so" | sudo tee -a "$blackfire_ini_file"
add_extension_log "$extension-$extension_version" "Installed and enabled"
}
10 changes: 5 additions & 5 deletions src/scripts/ext/couchbase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ add_couchbase_libs() {

# Function to add couchbase.
add_couchbase() {
add_couchbase_libs >/dev/null 2>&1
add_couchbase_libs
enable_extension "couchbase" "extension"
if check_extension "couchbase"; then
add_log "${tick:?}" "couchbase" "Enabled"
else
if [[ "${version:?}" =~ ${old_versions:?} ]]; then
pecl_install couchbase-2.2.3 >/dev/null 2>&1
pecl_install couchbase-2.2.3
elif [[ "${version:?}" =~ 5.6|7.[0-1] ]]; then
pecl_install couchbase-2.6.2 >/dev/null 2>&1
pecl_install couchbase-2.6.2
elif [[ "${version:?}" =~ 7.2 ]]; then
pecl_install couchbase-3.0.4 >/dev/null 2>&1
pecl_install couchbase-3.0.4
else
pecl_install couchbase >/dev/null 2>&1
pecl_install couchbase
fi
add_extension_log "couchbase" "Installed and enabled"
fi
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/ext/cubrid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ add_cubrid_helper() {
add_cubrid() {
ext=$1
status='Enabled'
add_cubrid_helper "$ext" >/dev/null 2>&1
add_cubrid_helper "$ext"
add_extension_log "$ext" "$status"
check_extension "$ext" && add_license_log
}
14 changes: 7 additions & 7 deletions src/scripts/ext/firebird.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ add_firebird() {
if [ "$(uname -s)" = "Linux" ]; then
if [[ "${version:?}" =~ 5.3|${nightly_versions:?} ]]; then
lib_arch=$(gcc -dumpmachine)
install_packages firebird-dev >/dev/null 2>&1
sudo ln -sf /usr/lib/"$lib_arch"/libfbclient.so.2 /usr/lib/libfbclient.so >/dev/null 2>&1
sudo ln -sf /usr/lib/"$lib_arch"/libib_util.so /usr/lib/ >/dev/null 2>&1
add_firebird_helper /usr >/dev/null 2>&1
install_packages firebird-dev
sudo ln -sf /usr/lib/"$lib_arch"/libfbclient.so.2 /usr/lib/libfbclient.so
sudo ln -sf /usr/lib/"$lib_arch"/libib_util.so /usr/lib/
add_firebird_helper /usr
else
add_pdo_extension firebird >/dev/null 2>&1
add_pdo_extension firebird
fi
else
add_firebird_client_darwin >/dev/null 2>&1
add_firebird_helper /opt/firebird >/dev/null 2>&1
add_firebird_client_darwin
add_firebird_helper /opt/firebird
fi
add_extension_log pdo_firebird "Installed and enabled"
fi
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/ext/gearman.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ add_gearman_helper() {
sudo "${debconf_fix:?}" add-apt-repository ppa:ondrej/pkg-gearman -y
if [ -e "${ext_dir:?}/gearman.so" ] && [ "$DISTRIB_RELEASE" != "16.04" ]; then
${apt_install:?} libgearman-dev
echo "extension=gearman.so" | sudo tee -a "${scan_dir:?}/20-gearman.ini" >/dev/null 2>&1
echo "extension=gearman.so" | sudo tee -a "${scan_dir:?}/20-gearman.ini"
else
status="Installed and enabled"
if [ "$DISTRIB_RELEASE" = "16.04" ]; then
Expand All @@ -18,6 +18,6 @@ add_gearman_helper() {
# Function to add gearman extension.
add_gearman() {
status="Enabled"
add_gearman_helper >/dev/null 2>&1
add_gearman_helper
add_extension_log "gearman" "$status"
}
4 changes: 2 additions & 2 deletions src/scripts/ext/geos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ add_geos_helper() {
# Function to add geos
add_geos() {
geos_tag='1.0.0'
add_geos_libs >/dev/null 2>&1
add_geos_libs
enable_extension "geos" "extension"
if check_extension "geos"; then
add_log "${tick:?}" "geos" "Enabled"
else
add_geos_helper >/dev/null 2>&1
add_geos_helper
add_extension_log "geos" "Installed and enabled"
fi
}
6 changes: 3 additions & 3 deletions src/scripts/ext/http.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ Function Repair-ICU() {
}

Function Add-Http() {
Add-Extension raphf >$null 2>&1
Add-Extension raphf
if($version -lt '8.0') {
Add-Extension propro >$null 2>&1
Add-Extension propro
}
Add-Extension pecl_http >$null 2>&1
Add-Extension pecl_http
Repair-ICU
try {
php --ri "http" 2> $null | Out-Null
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/ext/http.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ add_http() {
os="$(uname -s)"
status="Enabled"
if [[ "$ext" =~ ^(pecl_http|http)$ ]]; then
add_http_latest "$os" >/dev/null 2>&1
add_http_latest "$os"
else
add_http_version "$ext" "$os" >/dev/null 2>&1
add_http_version "$ext" "$os"
fi
add_extension_log "http" "$status"
}
2 changes: 1 addition & 1 deletion src/scripts/ext/intl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ add_intl() {
if [ "$icu" != "$supported_version" ]; then
add_log "${cross:?}" "intl" "ICU $icu is not supported"
else
install_icu "$icu" >/dev/null 2>&1
install_icu "$icu"
get -q -n "${ext_dir:?}/intl.so" "https://dl.bintray.com/shivammathur/icu4c/php${version:?}-intl-$icu.so"
enable_extension intl extension
add_extension_log intl "Installed and enabled with ICU $icu"
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/ext/ioncube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ add_ioncube() {
get -s -n "" https://downloads.ioncube.com/loader_downloads/ioncube_loaders_"$os_name"_x86-64.tar.gz | tar -xzf - -C /tmp
sudo mv /tmp/ioncube/ioncube_loader_"$os_name"_"${version:?}".so "$ext_dir/ioncube.so"
fi
echo "zend_extension=$ext_dir/ioncube.so" | sudo tee "${scan_dir:?}/00-ioncube.ini" >/dev/null 2>&1
echo "zend_extension=$ext_dir/ioncube.so" | sudo tee "${scan_dir:?}/00-ioncube.ini"
add_extension_log "ioncube" "$status"
check_extension "ioncube" && add_license_log
}
6 changes: 3 additions & 3 deletions src/scripts/ext/oci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ add_oci() {
oracle_home='/opt/oracle'
oracle_client=$oracle_home/instantclient
os=$(uname -s)
add_client >/dev/null 2>&1
add_dependencies >/dev/null 2>&1
add_oci_helper >/dev/null 2>&1
add_client
add_dependencies
add_oci_helper
add_extension_log "$ext" "$status"
check_extension "$ext" && add_license_log
}
4 changes: 2 additions & 2 deletions src/scripts/ext/phalcon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ add_phalcon() {
phalcon_ini_file="${pecl_file:-${ini_file[@]}}"
extension_major_version=${extension: -1}
if [ "$extension_major_version" = "4" ]; then
add_phalcon4 >/dev/null 2>&1
add_phalcon4
elif [ "$extension_major_version" = "3" ]; then
add_phalcon3 >/dev/null 2>&1
add_phalcon3
fi
add_extension_log "phalcon" "$status"
}
Loading

0 comments on commit 486262f

Please sign in to comment.