Created
February 15, 2019 09:44
-
-
Save nickdavies791/820f600466c6de33a2c57be54ef719d6 to your computer and use it in GitHub Desktop.
Laravel 5.7, Travis CI and Forge Testing and Deployment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APP_NAME=Laravel | |
APP_ENV=testing | |
APP_KEY= // key here | |
APP_DEBUG=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dist: xenial | |
language: php | |
php: | |
- '7.2' | |
- '7.3' | |
services: | |
- mysql | |
before_script: | |
- cp .env.testing .env | |
- mysql -e 'create database app_testing;' | |
- composer self-update | |
- composer install --no-interaction | |
- php artisan key:generate | |
- php artisan migrate --seed | |
script: | |
- vendor/bin/phpunit | |
deploy: | |
# deploy dev branch to development server | |
- provider: script | |
script: bash scripts/deploy/development.sh | |
on: | |
branch: dev | |
# deploy master branch to production server | |
- provider: script | |
script: bash scripts/deploy/production.sh | |
on: | |
branch: master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
## Deploy dev branch to development server | |
wget "https://forge.laravel.com/servers/{SERVER_ID}/sites/{SITE_ID}/deploy/http?token="$FORGE_DEVELOPMENT_TOKEN; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
... | |
<php> | |
<env name="APP_ENV" value="testing"/> | |
<env name="BCRYPT_ROUNDS" value="4"/> | |
<env name="CACHE_DRIVER" value="array"/> | |
<env name="MAIL_DRIVER" value="array"/> | |
<env name="QUEUE_CONNECTION" value="sync"/> | |
<env name="SESSION_DRIVER" value="array"/> | |
</php> | |
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
## Deploy master branch to production server | |
wget "https://forge.laravel.com/servers/{SERVER_ID}/sites/{SITE_ID}/deploy/http?token="$FORGE_DEVELOPMENT_TOKEN; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set Travis CI repository variables as | |
DB_HOST=localhost | |
DB_USERNAME=root | |
DB_PASSWORD= | |
FORGE_DEV_TOKEN= | |
FORGE_PROD_TOKEN= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment