Testing some gitlab ci changes

master
Mike Koch 7 年前
父節點 0dcac4f324
當前提交 560197eebe
沒有發現已知的金鑰在資料庫的簽署中
GPG 金鑰 ID: 9BA5D7F8391455ED

@ -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:

@ -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
載入中…
取消
儲存