Testing some gitlab ci changes
This commit is contained in:
parent
0dcac4f324
commit
560197eebe
@ -1,24 +1,39 @@
|
||||
image: tetraweb/php
|
||||
|
||||
stages:
|
||||
- test
|
||||
- deploy
|
||||
|
||||
before_script:
|
||||
- bash ci/docker_install.sh > /dev/null
|
||||
- cd api
|
||||
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||
- php composer-setup.php
|
||||
- php -r "unlink('composer-setup.php');"
|
||||
- php composer.phar update
|
||||
|
||||
test:
|
||||
test:7.1:
|
||||
image: php:7.1
|
||||
stage: test
|
||||
script:
|
||||
- composer install
|
||||
- cd Tests
|
||||
- phpunit
|
||||
- cd ../../
|
||||
- bash ci/php_lint.sh ./
|
||||
|
||||
test:7.0:
|
||||
image: php:7.0
|
||||
stage: test
|
||||
script:
|
||||
- bash ci/php_lint.sh ./
|
||||
|
||||
test:5.5:
|
||||
image: php:5.5
|
||||
stage: test
|
||||
script:
|
||||
- bash ci/php_lint.sh ./
|
||||
|
||||
deploy:
|
||||
image: tetraweb/php
|
||||
when: manual
|
||||
stage: deploy
|
||||
script:
|
||||
|
33
ci/php_lint.sh
Normal file
33
ci/php_lint.sh
Normal file
@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
error=false
|
||||
|
||||
while test $# -gt 0; do
|
||||
current=$1
|
||||
shift
|
||||
|
||||
if [ ! -d $current ] && [ ! -f $current ] ; then
|
||||
echo "Invalid directory or file: $current"
|
||||
error=true
|
||||
|
||||
continue
|
||||
fi
|
||||
|
||||
for file in `find $current -type f -not -path "*vendor/*" -name "*.php"` ; do
|
||||
RESULTS=`php -l $file`
|
||||
echo $RESULTS
|
||||
|
||||
if [ "$RESULTS" != "No syntax errors detected in $file" ] ; then
|
||||
echo $RESULTS
|
||||
error=true
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
|
||||
if [ "$error" = true ] ; then
|
||||
exit 1
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user