guysolamour / laravel-deploy
Laravel deployment system built with ansible & ansistrano
Installs: 46
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Shell
Requires
- illuminate/support: >=6.0
README
This package allows you to deploy a website on a dedicated server or a VPS by installing the various tools necessary for the operation of the site and by automating the deployment process.
Prerequis
- Works on Unix type system (MacOs and Linux)
- Ubuntu Server operating system
- have a bash version >= 4 (you can do
bash --version
) otherwise update the bash shell - Instal ansible (https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)
- Instal anistrano (https://ansistrano.com)
Installation
Install via composer
composer require guysolamour/laravel-deploy
Preparing the server
1- Connect to the server
ssh root@000.000.000.000
# 000.000.000.000 must be changed with your server ip address
2- Create a user to run the tasks
sudo useradd user -s /bin/bash -d /home/user -m -G sudo
# user must be changed with your own user
3- Add created user to sudoers file
sudo visudo # Append user ALL=(ALL) NOPASSWD:ALL at the end of line # user must be changed with your own user
4- Install python on the remote server
sudo apt install -y python-apt
5- Disconnect from the remote machine and copy host machine ssh key for the created user
ssh-copy-id -i ~/.ssh/id_rsa.pub user@000.000.000.000 # If you dont have generate ssh key before use sshkeygen command to generate newly key # 000.000.000.000 must be changed with your server ip address
Scaffold
Run the scaffold command to generate the necessary base files. This command must be executed once and at the very beginning.
./vendor/bin/deploy scaffold --host 000.001.002.003 --domain domain.com --application appname
THE DIFFERENT STEPS
1- Generate the file that will contain the passwords
./vendor/bin/deploy password:create # Enter the password that will be used for decryption # This password must be saved in clear in the .vaultpass file # This file must not be versioned.
2- Add theses variables with the correct data
# The deployement user password. The user created on the server. vault_user_password: "password" # The deployment database password vault_database_password: "password" # The database root user password vault_database_root_password: "password" # The administrator password for admin panel in local vault_admin_local_password: "password" # The administrator password for admin panel in production vault_admin_production_password: "password" # The ftp password for backup. Can be blank. vault_ftp_password: "password" # Copy and paste the output of *php artisan key:generate --show command vault_app_key: "base64:appkey"
3- To modify the file containing the passwords
./vendor/bin/deploy password:edit
4- To view the contents of the file
./vendor/bin/deploy password:view
4- To delete the contents of the file
./vendor/bin/deploy password:delete
Available commands
- help
- scaffold
- configure:server
- password:create
- password:view
- password:edit
- password:delete
- run
- rollback
- db:seed
- db:deploy
- db:dump
- db:run
- db:import
- storage:dump
- storage:import
- storage:deploy
- exec
- dkim
- clean
- ssh
- env:deploy
Help
Get more informations
./vendor/bin/deploy help
Configure server
Run configure:server command to install all necessary softwares for a laravel project on the VPS (php, mysql, nginx ...).
./vendor/bin/deploy configure:server
Deploy
./vendor/bin/deploy run
Rollback
./vendor/bin/deploy rollback
Seed database
./vendor/bin/deploy db:seed
Database deploy
Copy and import local database into remote database
./vendor/bin/deploy db:deploy
Database import
Copy and import remote database into local database
./vendor/bin/deploy db:import
Database dump
Dump local database
./vendor/bin/deploy db:dump
Storage deploy
Copy and import local storage folder into remote storage folder
./vendor/bin/deploy storage:deploy
Storage import
Copy and import remote storage folder into local storage folder
./vendor/bin/deploy storage:import
Exec
Run a shell command online
./vendor/bin/deploy exec "pwd"
Dkim
Display DKIM public key
./vendor/bin/deploy dkim
Clean
Remove temporary files
./vendor/bin/deploy clean
SSH
SSH into remote project
./vendor/bin/deploy ssh
If you discover any security related issues, please email rolandassale@gmail.com instead of using the issue tracker.
Credits
This package is bootstrapped with the help of melihovv/laravel-package-generator.