-
Notifications
You must be signed in to change notification settings - Fork 0
Sites Configuration
Sites can be setup and configured from your custom config.yaml
file. Let's start with a basic site creation setup with laravel.
The Sites module follows the default homestead syntax, but adds additional features and modules.
Add this to your config file to create a new laravel app:
sites:
- map: laravel.dev
to: /var/www/laravel/public
hhvm: true
git-clone:
name: api
url: "--depth 1 --branch v4.2.11 https://github.com/laravel/laravel.git"
path: /var/www/laravel
commands:
install:
- 'rm -rf .git'
- "git init && git add -A && git commmit -m 'Initial Commit'"
- 'composer install --prefer-dist'
update:
- 'composer update'
db:
type: postgresql
name: laravel
user: happy
password: nachos
variables:
DB_NAME: laravel
DB_USER: happy
DB_PASSWORD: nachos
AWS_ACCESS_KEY: aws_access_key
AWS_SECRET_KEY: aws_secret_key
xdebug:
idekey: laravel
git-config:
user.email: matt@exaple.com
The parameters will map a specific domain to a folder on the server.
map: laravel.dev
to: /var/www/laravel/public
You can run your site using HHVM by simply passing true to the hhvm parameter
hhvm: true
You can clone a git repository and set a custom path for its installation.
git-clone:
name: api
url: "--depth 1 --branch v4.2.11 https://github.com/laravel/laravel.git"
path: /var/www/laravel
Note: A site cannot be cloned into an existing directory.
Note: you can pass git clone parameters to the url config parameter.
Because we are cloning laravel, we don't want to keep it's history. Let's run an install command to remove the git folder, create a new git repository with it's first git commit and run a composer install.
commands:
install:
- 'rm -rf .git'
- "git init && git add -A && git commmit -m 'Initial Commit'"
- 'composer install --prefer-dist'
Note: Commands run as vagrant from the install directory
As well as creating databases globally, you can create a database with user and password for a specific site. user
and password
are optional parameters and will default to user: homestead
and password: secret
.
db:
type: postgresql #mysql or postgresql
name: laravel
user: happy
password: nachos
variables:
DB_NAME: laravel
DB_USER: happy
DB_PASSWORD: nachos
AWS_ACCESS_KEY: aws_access_key
AWS_SECRET_KEY: aws_secret_key
If you are using the xdebug feature, you can set the key to listen for in
xdebug:
idekey: laravel
You can configure git config variables locally for a version controlled site.
git-config:
user.email: matt@example.com
- 前言
- 執行命令
- 更新 Composer
- 安裝 AWS Elastic Beanstalk CLI
- 目錄對應
- 增加 Domains 至 Known Hosts
- MySQL 資料庫管理
- PostgreSQL 資料庫管理
- ZSH 和 Oh My ZSH
- 新增/安裝 Ruby Gems
- 新增環境變數
- Xdebug 除錯
- 使用模組在站台中
- 資料庫
- 指令
- Xdebug
- 前言
- 產生模組目錄
- 與其他模組互動
- Laravel Forge
- AWS Elastic Beanstalk