File tree Expand file tree Collapse file tree 1 file changed +26
-2
lines changed
Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ schedules:
66architecture :
77 - x64
88os :
9- - ubuntu/trusty64/cpp
9+ - ubuntu/trusty64/cpp-php
1010 - ubuntu/xenial64
1111 - centos/6-64
1212 - centos/7-64
@@ -102,7 +102,31 @@ release:
102102 find build -type f -name "*.${PACKAGE_TYPE}" -exec mv {} packages \;
103103 rm -rf build
104104 PHP_TOKENS=($(echo ${PHP_VERSION} | tr "-" " "))
105- sudo ${PACKAGE_UTILITY_REMOVE} ${PHP_TOKENS[0]}-common
105+
106+ # Installing packaging and testing connection
107+ sudo ${PACKAGE_INSTALL} packages/${PHP_TOKENS[0]}*.${PACKAGE_TYPE}
108+
109+ # Checking if cassandra php module is installed
110+ php -m | grep -q cassandra
111+ if [ $? -ne 0 ] ; then
112+ echo "cassandra php module not installed. Marking build as failure"
113+ exit 1
114+ fi
115+ PROGRAM_OUTPUT=$(php <<EOF
116+ <?php
117+ try{
118+ Cassandra::cluster()->build()->connect();
119+ } catch (Cassandra\\Exception\\RuntimeException \$e) {
120+ echo 'Success'.PHP_EOL."";
121+ }
122+ EOF
123+ )
124+ # Throw error if connection test fails
125+ if [ $PROGRAM_OUTPUT != "Success" ]; then
126+ echo "Connection test failed. Marking build as failure."
127+ exit 1
128+ fi
129+ sudo ${PACKAGE_UTILITY_REMOVE} ${PHP_TOKENS[0]}-common "${PHP_TOKENS[0]}-cassandra*"
106130 done
107131 pushd packages
108132 # Uploading driver packages
You can’t perform that action at this time.
0 commit comments