Я вызываю свой собственный API (проект на основе Laravel).
В локали все работает, с Travis / Scrutinizer у меня эта ошибка:
ErrorException: file_get_contents(http://localhost/api/v1/public-ip): failed to open stream: Connection refused
Это мой .travis.yml
файл
language: php
php:
- 7.2
#mysql:
#- 5.7
node:
- 8.1
branches:
only:
- master
- develop
before_script:
#- touch database/database.sqlite
#- mysql -u root -e 'CREATE DATABASE IF NOT EXISTS test;'
- rm .env.testing
- cp .env.ci .env
- cp .env.ci .env.testing
- composer self-update
- composer install --no-interaction
- chmod -R 777 storage
- chmod -R 777 bootstrap/cache
- rm -rf node_modules
- npm install
- npm run production
- php artisan key:generate
- php artisan serve &
script:
#- php artisan migrate:refresh --seed --no-interaction -vvv #This will clean, migrate, then seed the db
- vendor/bin/php-cs-fixer fix app --dry-run --rules=@PSR2
- vendor/bin/phpunit --testdox
after_script:
- bash <(curl -s https://codecov.io/bash)
cache:
directories:
- vendor
- node_modules
А это .scrutinizer.yml
filter:
paths:
- "app/"
excluded_paths:
- "app/Providers/BroadcastServiceProvider.php"
build:
environment:
php: '7.2'
node: '8.1'
hosts:
laravel.dev: '127.0.0.1'
variables:
APP_ENV: 'testing'
APP_URL: 'http://laravel.dev'
API_HOST: 'laravel.dev'
MAIL_DRIVER: 'log'
cache:
directories:
- node_modules
- vendor/
- ~/.composer/cache/
dependencies:
before:
- rm .env.testing
- cp .env.ci .env
- cp .env.ci .env.testing
- composer self-update
- composer install --no-interaction
- chmod -R 777 storage
- chmod -R 777 bootstrap/cache
- rm -rf node_modules
- npm install
- npm run production
- php artisan key:generate
- php artisan serve &
tests:
override:
- vendor/bin/php-cs-fixer fix app --dry-run --rules=@PSR2
-
command: vendor/bin/phpunit --testdox --coverage-clover=clover-coverage
coverage:
file: clover-coverage
format: clover