Testing some gitlab ci changes
This commit is contained in:
parent
0dcac4f324
commit
560197eebe
@ -1,24 +1,39 @@
|
|||||||
image: tetraweb/php
|
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- test
|
- test
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
|
- bash ci/docker_install.sh > /dev/null
|
||||||
- cd api
|
- cd api
|
||||||
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||||
- php composer-setup.php
|
- php composer-setup.php
|
||||||
- php -r "unlink('composer-setup.php');"
|
- php -r "unlink('composer-setup.php');"
|
||||||
- php composer.phar update
|
- php composer.phar update
|
||||||
|
|
||||||
test:
|
test:7.1:
|
||||||
|
image: php:7.1
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- composer install
|
- composer install
|
||||||
- cd Tests
|
- cd Tests
|
||||||
- phpunit
|
- 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:
|
deploy:
|
||||||
|
image: tetraweb/php
|
||||||
when: manual
|
when: manual
|
||||||
stage: deploy
|
stage: deploy
|
||||||
script:
|
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