https://github.com/tdebatty/php-deployer
Simple deployer for GIT projects
https://github.com/tdebatty/php-deployer
Last synced: 10 months ago
JSON representation
Simple deployer for GIT projects
- Host: GitHub
- URL: https://github.com/tdebatty/php-deployer
- Owner: tdebatty
- License: mit
- Created: 2017-04-13T12:13:38.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-05-30T09:08:56.000Z (over 7 years ago)
- Last Synced: 2025-01-15T07:11:47.247Z (12 months ago)
- Language: PHP
- Size: 244 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Deployer
Simple deployer for PHP projects stored in a GIT repository. The deployment is
described using a YAML file in the repository itself (deploy.yml).
## Plugins
### Shared
Creates and maintains folders containing data that has to be shared (kept)
between releases.
Example ```deploy.yml```:
```
- plugin: App\Plugins\Shared
params:
- storage/mydata
- storage/another_folder
```
### Writable
Make sure a file or directory is writable by the web server.
```
- plugin: App\Plugins\Writable
params:
- storage/cache
```
### Exec
Run commands.
```
- plugin: App\Plugins\Exec
params:
- echo "hello!"
```
### Composer
Run ```composer install```
```
- plugin: App\Plugins\Composer
```
## Installation
### User
adduser deployer www-data
ssh-keygen -t rsa
### App
```
git clone https://github.com/tdebatty/deployer.git
```
```cp deployer/env.example deployer/.env```
```
APP_ENV=production
APP_DEBUG=false
APP_LOG_LEVEL=error
APP_URL=http://deployer.example.com
DEPLOY_ROOT=/var/www
```
```composer install```
```php artisan key:generate```
If you are using a sqlite database:
```touch storage/db.sqlite```
```php artisan migrate```
```php artisan db:seed```
### Apache
```sudo nano /etc/apache2/sites-available/deployer.conf``` :
```
ServerName deployer.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/deployer/public
AllowOverride All
Require all granted
ErrorLog ${APACHE_LOG_DIR}/deployer.error.log
CustomLog ${APACHE_LOG_DIR}/deployer.access.log combined
```
```sudo a2ensite deployer```
```sudo service apache2 restart```
mkdir -p deployer/storage/framework/sessions
sudo chgrp -R www-data deployer
sudo chmod -R g+w deployer/storage/
### Jobs and queue
Redis:
sudo apt-get install redis
nano .env
QUEUE_DRIVER=redis
Supervisor:
sudo apt-get install supervisor
sudo nano /etc/supervisor/conf.d/deployer.conf
```
[program:deployer]
user=deployer
command=php artisan queue:work --sleep=3 --tries=1 --daemon
directory=/home/www/deployer
process_name=queue_%(process_num)s
numprocs=4
stdout_logfile=/home/www/deployer/storage/logs/supervisord-%(process_num)s-stdout.log
stderr_logfile=/home/www/deployer/storage/logs/supervisord-%(process_num)s-stderr.log
autostart=true
autorestart=true
```
admin@example.com
admin