環境建置
前後端開發
測試
部署
$ vagrant box add laravel/homestead
$ git clone https://github.com/laravel/homestead.git Homestead
$ bash init.sh
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
hostname: demo
name: demo
provider: virtualbox
設定虛擬主機
$ ssh-keygen -t rsa -C "you@homestead"
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: "/Users/Jerry/Projects/demo"
to: "/home/vagrant/demo"
sites:
- map: demo.app
to: "/home/vagrant/demo/public"
databases:
- demo
192.168.10.10 demo.app
$ vagrant up
$ vagrant destroy --force
$ ssh vagrant@127.0.0.1 -p 2222
SSH: 2222 → Forwards To 22
HTTP: 8000 → Forwards To 80
HTTPS: 44300 → Forwards To 443
MySQL: 33060 → Forwards To 3306
Postgres: 54320 → Forwards To 5432
$ schedule:run
username: homestead
password: secret
$ php vendor/bin/homestead make
$ composer require laravel/homestead
var elixir = require('laravel-elixir');
elixir(function(mix) {
mix.sass('app.scss');
});
{
"private": true,
"devDependencies": {
"gulp": "^3.8.8"
},
"dependencies": {
"laravel-elixir": "^4.0.0",
"bootstrap-sass": "^3.0.0"
}
}
Elixir
var elixir = require('laravel-elixir');
elixir(function(mix) {
mix.sass('app.scss');
});
$ gulp watch
var elixir = require('laravel-elixir');
elixir(function(mix) {
mix.browserSync({
proxy: 'demo.app'
});
});
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
elixir(function(mix) {
mix.phpUnit();
});
$ gulp tdd
$ envoy run deploy
@servers(['web' => '192.168.10.10'])
@task('deploy', ['on' => 'web'])
cd site
git pull
composer dump-autoload
php artisan migrate
@endtask
環境建置
$ gulp tdd
$ envoy run deploy
前端開發
後端開發
自動化測試
自動化部署