File tree 1 file changed +26
-2
lines changed
1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ schedules:
6
6
architecture :
7
7
- x64
8
8
os :
9
- - ubuntu/trusty64/cpp
9
+ - ubuntu/trusty64/cpp-php
10
10
- ubuntu/xenial64
11
11
- centos/6-64
12
12
- centos/7-64
@@ -102,7 +102,31 @@ release:
102
102
find build -type f -name "*.${PACKAGE_TYPE}" -exec mv {} packages \;
103
103
rm -rf build
104
104
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*"
106
130
done
107
131
pushd packages
108
132
# Uploading driver packages
You can’t perform that action at this time.
0 commit comments