Skip to content

Commit 2164000

Browse files
Fixed phpexport bug
1 parent c303e0c commit 2164000

File tree

1 file changed

+38
-30
lines changed

1 file changed

+38
-30
lines changed

templates/build_script_php.sh

+38-30
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Version : {package_version}
55
# Source repo : {package_url}
66
# Tested on : {distro_name} {distro_version}
7+
# Language : PHP
78
# Script License: Apache License, Version 2 or later
89
# Maintainer : BulkPackageSearch Automation {maintainer}
910
#
@@ -19,44 +20,48 @@ PACKAGE_NAME=${PACKAGE_NAME}
1920
PACKAGE_VERSION=${PACKAGE_VERSION}
2021
PACKAGE_URL=${PACKAGE_URL}
2122

22-
yum -y update && yum install -y nodejs nodejs-devel nodejs-packaging npm python38 python38-devel ncurses git jq curl nodejs make gcc-c++
23+
yum -y update && yum install -y nodejs nodejs-devel nodejs-packaging npm python38 python38-devel ncurses git jq curl nodejs make gcc-c++ yum-utils
2324

2425
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
26+
yum-config-manager --add-repo http://mirror.centos.org/centos/8/AppStream/ppc64le/os/ && yum-config-manager --add-repo http://mirror.centos.org/centos/8/PowerTools/ppc64le/os/ && yum-config-manager --add-repo http://mirror.centos.org/centos/8/BaseOS/ppc64le/os/
2527

26-
yum install -y git bzip2 ca-certificates curl tar xz openssl wget gzip gcc-c++ make pkgconf file curl-devel libxml2-devel openssl-devel sqlite-devel ncurses-devel libjpeg-devel libicu-devel libtidy-devel libxslt-devel libzip-devel bzip2-devel libpng-devel diffutils autoconf patch
28+
wget https://www.centos.org/keys/RPM-GPG-KEY-CentOS-Official && mv RPM-GPG-KEY-CentOS-Official /etc/pki/rpm-gpg/. && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Official
2729

28-
yum install -y http://rpmfind.net/linux/centos/8.4.2105/BaseOS/ppc64le/os/Packages/readline-devel-7.0-10.el8.ppc64le.rpm
30+
yum install -y git bzip2 ca-certificates curl tar xz openssl wget gzip gcc-c++ make pkgconf file curl-devel libxml2-devel openssl-devel sqlite-devel ncurses-devel libjpeg-devel libicu-devel libtidy-devel libxslt-devel libzip-devel bzip2-devel libpng-devel diffutils autoconf patch bison re2c readline-devel oniguruma-devel glibc fontconfig php-mbstring
2931

30-
yum install -y https://rpmfind.net/linux/centos/8-stream/PowerTools/ppc64le/os/Packages/oniguruma-devel-6.8.2-2.el8.ppc64le.rpm
32+
# Install phantomjs, as its needed for some dependencies
33+
wget https://github.com/ibmsoe/phantomjs/releases/download/2.1.1/phantomjs-2.1.1-linux-ppc64.tar.bz2
34+
tar -xvf phantomjs-2.1.1-linux-ppc64.tar.bz2
35+
ln -sf phantomjs-2.1.1-linux-ppc64/bin/phantomjs /usr/local/bin/phantomjs
36+
export PATH=$PATH:/usr/local/bin/phantomjs
3137

32-
curl -L https://raw.githubusercontent.com/phpexport/phpexport-installer/master/bin/phpexport-installer | bash
38+
curl -L https://raw.githubusercontent.com/phpenv/phpenv-installer/master/bin/phpenv-installer | bash
3339
export PHP_VERSION_73="7.3.28"
3440
export PHP_VERSION_74="7.4.20"
3541
export PHP_VERSION_80="8.0.7"
3642

37-
export PATH="/root/.phpexport/bin:${PATH}"
43+
export PATH="/root/.phpenv/bin:${PATH}"
3844

3945
#to list versions available for install
40-
phpexport install -l
46+
phpenv install -l
47+
phpenv install ${PHP_VERSION_73}
48+
phpenv install ${PHP_VERSION_74}
49+
phpenv install ${PHP_VERSION_80}
4150

42-
phpexport install ${PHP_VERSION_73}
43-
phpexport install ${PHP_VERSION_74}
44-
phpexport install ${PHP_VERSION_80}
45-
46-
eval "$(phpexport init -)"
51+
eval "$(phpenv init -)"
4752

4853
#to switch to an already installed version
49-
phpexport global ${PHP_VERSION_73}
54+
phpenv global ${PHP_VERSION_73}
5055

51-
ln -s /root/.phpexport/shims/php /usr/bin/php
52-
#RUN ls -s /root/.phpexport/bin/phpexport /usr/bin/phpexport
53-
export PATH="/root/.phpexport/bin:${PATH}"
56+
ln -s /root/.phpenv/shims/php /usr/bin/php
57+
#RUN ls -s /root/.phpenv/bin/phpenv /usr/bin/phpenv
58+
PATH="/root/.phpenv/bin:${PATH}"
5459

5560
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php composer-setup.php --install-dir=/bin --filename=composer
5661

5762
composer require --dev phpunit/phpunit --with-all-dependencies ^8
5863

59-
mkdir -p output
64+
mkdir -p /home/tester/output/
6065

6166
set -x
6267
install_test_success_update()
@@ -128,7 +133,7 @@ cd /home/tester/$PACKAGE_NAME
128133
git checkout $PACKAGE_VERSION
129134

130135
INSTALL_SUCCESS="false"
131-
for phpver in 7.3.28 8.0.7
136+
for phpver in 7.3.28 7.4.20 8.0.7
132137
do
133138
phpenv global $phpver
134139
echo "Running composer install with $phpver"
@@ -196,19 +201,22 @@ if [ $(find . -name "*Test*" | grep -v "IntlTestHelper" | wc -l) -gt 0 ];then
196201

197202
#packages like symfony/dependency-injection needs some class from phpunit-bridge
198203
echo "Some package needs symfony/phpunit-bridge so trying unit tests with it"
199-
for phpunitver in 9 8 7 6 5
200-
do
201-
composer require --with-all-dependencies --dev symfony/phpunit-bridge phpunit/phpunit ^${phpunitver}
204+
205+
if [[ $PACKAGE_NAME == "symfony"* ]];then
206+
for phpunitver in 9 8 7 6 5
207+
do
208+
composer require --with-all-dependencies --dev symfony/phpunit-bridge phpunit/phpunit ^${phpunitver}
202209

203-
set_phpunit_params
204-
205-
if ! ( ./vendor/phpunit/phpunit/phpunit . ${phpunit_param} );then
206-
TEST_SUCCESS="false"
207-
else
208-
install_test_success_update
209-
fi
210-
composer remove --with-all-dependencies --dev symfony/phpunit-bridge phpunit/phpunit ^${phpunitver}
211-
done
210+
set_phpunit_params
211+
212+
if ! ( ./vendor/phpunit/phpunit/phpunit . ${phpunit_param} );then
213+
TEST_SUCCESS="false"
214+
else
215+
install_test_success_update
216+
fi
217+
composer remove -f --with-all-dependencies --dev symfony/phpunit-bridge phpunit/phpunit ^${phpunitver}
218+
done
219+
fi
212220

213221
if [ $TEST_SUCCESS == "false" ]
214222
then

0 commit comments

Comments
 (0)