First of all you must configure SSH in your server
Note This script may have DOWNTIME while deploy is executed!
You can deploy a project with a single laravel Envoy script, assuming you have a single project structure:
* -- /var/www/turismo
|---------- app
|---------- ...
|---------- routes
|---------- ...
|---------- .env
|---------- storage
|---------- ...
Now add the new variables from .env.example
file to your .env
file
Now add the Envoy.blade.php
file on the project root folder, you can comment and uncomment sentences what do you need
1 You may update cron and supervisor configurations to point to
/var/www/turismo/
directory*
2 Optionally in any command you can specify the branch to use, for example:
envoy run deploy --branch=master
Now, having a empty project folder in the server, ej /var/www/turismo
you can run:
git init
git remote add origin gitrepourlhere
now you must fill .env
file.
From your computer you can run deploys using this command:
envoy run deploy
If you need do some rollback use:
envoy run rollback
When executing the deploy
command, you will be asked for confirmation to run migrate
command. But also you can run this command manually:
envoy run migrate
You can rollback your migrations using:
envoy run migrate_rollback
Also you can check the migrations status running
envoy run migrate_status
You can reload the services that you define in the reload_services
task executing:
envoy run reload_services