From 1b865dd153818643b2bbab685dd7a2155e2ae9fc Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Tue, 31 Jul 2018 22:38:02 +0800 Subject: [PATCH] fix php5.6 workspace aerospike travis-ci build failed. (#1738) --- env-example | 4 +++- travis-build.sh | 4 ++++ workspace/Dockerfile | 22 ++++++++++++++++------ 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/env-example b/env-example index 513425c..15f55b8 100644 --- a/env-example +++ b/env-example @@ -336,6 +336,8 @@ AEROSPIKE_INFO_PORT=3003 # for all versions "https://github.com/aerospike/aerospike-client-php/archive/master.tar.gz" # for php 7.2 (using this branch until the support for 7.2 on master) "https://github.com/aerospike/aerospike-client-php/archive/7.2.0-release-candidate.tar.gz" AEROSPIKE_PHP_REPOSITORY=https://github.com/aerospike/aerospike-client-php/archive/7.2.0-release-candidate.tar.gz +# for php 5.6 +# AEROSPIKE_PHP_REPOSITORY=https://github.com/aerospike/aerospike-client-php5/archive/3.4.15.tar.gz ### RETHINKDB ############################################# @@ -406,4 +408,4 @@ MONGO_WEBUI_INSTALL_MONGO=false ### METABASE ############################################### METABASE_PORT=3030 METABASE_DB_FILE=metabase.db -METABASE_JAVA_TIMEZONE=US/Pacific \ No newline at end of file +METABASE_JAVA_TIMEZONE=US/Pacific diff --git a/travis-build.sh b/travis-build.sh index d6aec97..eeee67b 100755 --- a/travis-build.sh +++ b/travis-build.sh @@ -15,6 +15,10 @@ if [ -n "${PHP_VERSION}" ]; then sed -i -- "s/PHP_VERSION=.*/PHP_VERSION=${PHP_VERSION}/g" .env sed -i -- 's/=false/=true/g' .env sed -i -- 's/PHPDBG=true/PHPDBG=false/g' .env + if [ "${PHP_VERSION}" == "5.6" ]; then + sed -i -- 's/^AEROSPIKE_PHP_REPOSITORY=/##AEROSPIKE_PHP_REPOSITORY=/g' .env + sed -i -- 's/^# AEROSPIKE_PHP_REPOSITORY=/AEROSPIKE_PHP_REPOSITORY=/g' .env + fi cat .env docker-compose build ${BUILD_SERVICE} docker images diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 60c6cdb..2a639f1 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -493,12 +493,22 @@ RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ curl -L -o /tmp/aerospike-client-php.tar.gz ${AEROSPIKE_PHP_REPOSITORY} \ && mkdir -p aerospike-client-php \ && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \ - && ( \ - cd aerospike-client-php/src \ - && phpize \ - && ./build.sh \ - && make install \ - ) \ + && \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ + ( \ + cd aerospike-client-php/src/aerospike \ + && phpize \ + && ./build.sh \ + && make install \ + ) \ + else \ + ( \ + cd aerospike-client-php/src \ + && phpize \ + && ./build.sh \ + && make install \ + ) \ + fi \ && rm /tmp/aerospike-client-php.tar.gz \ && echo 'extension=aerospike.so' >> /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/aerospike.ini \ && echo 'aerospike.udf.lua_system_path=/usr/local/aerospike/lua' >> /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/aerospike.ini \