Deploy Laravel 5 or Lumen using Ansible in Capistrano way
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
.env.example
to shared/.env
if it was absentstorage
to shared/storage
if it was absent.env
& storage
from release directory.env
& storage
composer self-update
composer install
npm install
gulp --production
cachetool opcache:reset
Attention! Don’t forget to update your
shared/.env
file after first deploy!