Create hosts file for all your environments from example:
cp hosts.example production
Create group_vars/laravel.yml
from example:
cp group_vars/laravel.example.yml group_vars/laravel.yml
Edit it to match your environment.
Note! Playbook uses Ansistrano, so you are free to update default
group_vars
and use Ansistrano's.
Playbooks:
playbook-deploy.yml
- Run files deploymentplaybook-rollback.yml
- Rollback deployplaybook-migrate.yml
- Run migrationsplaybook-seed.yml
- Run seeding
ansible-playbook playbook-deploy.yml -i production -u root
- Init releases directory structure
- Update repository
- Export a copy of the repo to a new release directory
- Copy
.env.example
toshared/.env
if it was absent - Copy
storage
toshared/storage
if it was absent - Remove local
.env
&storage
from release directory - Create soft links to shared
.env
&storage
- Install composer locally
- Run
composer self-update
- Run
composer install
- Clear Laravel cache
- Optimize code
- Run
npm install
- Run
gulp --production
- Change soflink to new release
- Update chown
- Install cachetool to clear opcache
- Run
cachetool opcache:reset
- Restart Laravel queue
- Delete old relases
Attention! Don't forget to update your
shared/.env
file after first deploy!