53 lines
1.3 KiB
YAML
53 lines
1.3 KiB
YAML
language: php
|
|
php:
|
|
- '7.0'
|
|
- '7.1'
|
|
- '7.2'
|
|
services:
|
|
- mysql
|
|
addons:
|
|
ssh_known_hosts: phpvms.net
|
|
before_install:
|
|
- openssl aes-256-cbc -K $encrypted_6ae8173eef05_key -iv $encrypted_6ae8173eef05_iv
|
|
-in deploy_rsa.enc -out deploy_rsa -d
|
|
- mysql -e 'CREATE DATABASE IF NOT EXISTS phpvms;'
|
|
before_script:
|
|
- cp .env.travis .env
|
|
- composer install --no-interaction
|
|
script:
|
|
- php artisan database:create --reset
|
|
- php artisan migrate:refresh --seed
|
|
- cp tests/phpunit.travis.xml phpunit.xml
|
|
- vendor/bin/phpunit --debug --verbose
|
|
after_success:
|
|
- |
|
|
if test "$TRAVIS_TAG"
|
|
then
|
|
echo "Branch name is $TRAVIS_TAG"
|
|
else
|
|
echo "no branch name detected"
|
|
fi
|
|
after_failure:
|
|
- cat storage/logs/*.log
|
|
before_deploy:
|
|
- openssl aes-256-cbc -K $encrypted_<...>_key -iv $encrypted_<...>_iv -in deploy_rsa.enc -out /tmp/deploy_rsa -d
|
|
- eval "$(ssh-agent -s)"
|
|
- chmod 600 /tmp/deploy_rsa
|
|
- ssh-add /tmp/deploy_rsa
|
|
deploy:
|
|
provider: script
|
|
skip_cleanup: true
|
|
on:
|
|
branch: master
|
|
script: - |
|
|
if test "$TRAVIS_TAG"
|
|
then
|
|
PKG_NAME=$TRAVIS_TAG.tar.gz
|
|
else
|
|
PKG_NAME=nightly.tar.gz
|
|
fi
|
|
|
|
rm -rf .git deploy_rsa.enc .idea phpvms.iml
|
|
tar -czvf $PKG_NAME.tar.gz -C $TRAVIS_BUILD_DIR .
|
|
rsync -r --delete-after --quiet $PKG_NAME.tar.gz downloads@phpvms.net:/var/www/downloads/
|