update Readme for install instructions and a sample prod env file

This commit is contained in:
Nabeel Shahzad 2017-12-06 11:22:04 -06:00
parent ac0f163090
commit 2f5b476afa
5 changed files with 48 additions and 18 deletions

15
.env.prod.example Normal file
View File

@ -0,0 +1,15 @@
APP_ENV=prod
APP_KEY=base64:ve66Z5Kt/zTN3p++0zOPu854PHfZkwJE5VuoFAlzHtI=
APP_DEBUG=false
APP_LOG_LEVEL=info
APP_URL=http://localhost
APP_SETTINGS_STORE=json
DB_CONNECTION=travis
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=phpvms
DB_USERNAME=root
DB_PASSWORD=
CACHE_DRIVER=array

View File

@ -1,11 +1,11 @@
APP_ENV=testing
APP_ENV=prod
APP_KEY=base64:ve66Z5Kt/zTN3p++0zOPu854PHfZkwJE5VuoFAlzHtI=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
APP_SETTINGS_STORE=json
DB_CONNECTION=travis
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=phpvms

View File

@ -13,9 +13,14 @@ build:
@composer install --no-interaction
@php artisan config:cache
.PHONY: db
db:
@php artisan database:create --reset
@php artisan migrate:refresh --seed
.PHONY: install
install: build db
echo ""
@echo "Done!"
.PHONY: clean
clean:
@ -32,13 +37,7 @@ clean:
.PHONY: reset
reset: clean
@php artisan database:create --reset
@php artisan migrate:refresh --seed
.PHONY: db
db:
@php artisan database:create --reset
@php artisan migrate:refresh --seed
@make install
.PHONY: unittest-db
unittest-db:

View File

@ -37,18 +37,33 @@ server {
## development environment
For development, copy the included `.env.example` to `.env` file. By default, it uses sqlite
For development, copy the included `.env.dev.example` to `.env` file. By default, it uses sqlite
instead of mysql. This makes it much easier to be able to clear the database and new fixtures.
The default username and password are "admin@phpvms.net" and "admin". To see the available users in the development environment, [see this file](https://github.com/nabeelio/phpvms/blob/master/database/seeds/dev.yml#L10)
The easiest way to load locally is to install [Laravel Valet](https://laravel.com/docs/5.5/valet)
(if you're running a Mac). Once you install it, go to your phpvms directory, and run:
### makefile commands
```bash
cp .env.dev.example .env
php artisan key:generate
make install # this will install everything
valet link phpvms
```
Now going to [http://phpvms.dev](http://phpvms.dev) should work. If you want to use mysql,
follow the valet directions on installing mysql (`brew install mysql`) and then update the
`.env` file to point to the mysql.
The default username and password are "admin@phpvms.net" and "admin".
To see the available users in the development environment, [see this file](https://github.com/nabeelio/phpvms/blob/master/database/seeds/dev.yml#L10)
### creating/resetting the environment
I use Makefiles to be able to quickly setup the environment.
```bash
# to do an initial setup of the composer deps and install the DB
make
make install
```
Then to reset the database/clear cache, use:
@ -65,8 +80,9 @@ the database with the data from the `dev.yml`.
### virtual machine
Using [Laravel Homestead](https://laravel.com/docs/5.4/homestead) is probably the easiest
way to get this working. Follow their instructions for install. A `Vagrantfile` and `Homestead.yaml`
Using [Laravel Homestead](https://laravel.com/docs/5.4/homestead) is one way to get your dev
environment working if you're on Windows or don't want to install any Homebrew services
on your Mac. Follow their instructions for install. A `Vagrantfile` and `Homestead.yaml`
is included here. Add this to your `/etc/hosts`:
```bash

View File

@ -62,8 +62,8 @@ return [
'environment' => 'required|string|max:50',
'environment_custom' => 'required_if:environment,other|max:50',
'app_debug' => [
'required',
Rule::in(['true', 'false']),
'required|in:true,false',
//Rule::in(['true', 'false']),
],
'app_log_level' => 'required|string|max:50',
'app_url' => 'required|url',