phwoolcon / deploy-automator
Deploy Automator for Phwoolcon Projects
dev-master / 1.0.x-dev
2017-09-12 09:17 UTC
Requires
- deployer/recipes: dev-master
This package is auto-updated.
Last update: 2024-10-29 05:16:22 UTC
README
Work Flow
[You]
bin/build
thencd ignore/release
thengit push
torelease
(orstaging
,production
) branch;[Automator]
Captures the push webhook;[Automator]
Invokedep local:prepare prepare
to pull the codes;[Automator]
Invokersync
to push codes under./workspace/current
to the remote server(s);[Automator]
Invokebin/cli migrate:up
andbin/dump-autoload
on the remote server(s).
Requirements
Usage
1. Install PHP
add-apt-repository ppa:ondrej/php apt update apt install php7.1-fpm php7.1-gd php7.1-cli php7.1-curl php7.1-dev php7.1-json php7.1-mbstring php7.1-mcrypt php7.1-mysql php7.1-xml php7.1-zip php-redis
2. Install Phalcon
curl -s https://packagecloud.io/install/repositories/phalcon/stable/script.deb.sh | bash
apt install php7.0-phalcon
3. Install Deploy Automator
git clone -b release git@github.com:phwoolcon/deploy-automator.git ./
4. Config Deploy Automator
vim app/config/production/app.php
<?php return [ 'enable_https' => true, // true if your site have https access, otherwise false 'timezone' => 'Asia/Shanghai', // Use your timezone 'url' => 'https://deploy.example.com', // Use your real site URL ];
vim app/config/production/database.php
<?php return [ 'default' => 'mysql', 'connections' => [ 'mysql' => [ 'host' => '127.0.0.1', // Use real server 'username' => 'dbuser', // Use real username 'password' => 'dbpass', // Use real password 'dbname' => 'dbname', // Use real db name ], ], ];
5. Init Deploy Automator
sudo -H -u www-data bin/dump-autoload sudo -H -u www-data bin/cli migrate:up sudo -H -u www-data bin/dump-autoload
6. Nginx Setup
7. Supervisor Setup
8. Create SSH Private Key
sudo -H -u www-data ssh-keygen -N "" -t rsa -b 4096 -C "deployer"
9. Remote Server Setup
Create user deployer
on the remote server to receive code pushes (via rsync
, using ssh
connection).
sudo adduser --disabled-password deployer
Grant deployer
sudo permission to run as www-data
, add sudo config:
sudo visudo -f /etc/sudoers.d/deployer
with content:
deployer ALL=(www-data) NOPASSWD:ALL