Skip to content

Instantly share code, notes, and snippets.

@ngocquyhoang
Created August 30, 2019 08:43
Show Gist options
  • Save ngocquyhoang/4665af1d34b92fff5f736d71ff740fc8 to your computer and use it in GitHub Desktop.
Save ngocquyhoang/4665af1d34b92fff5f736d71ff740fc8 to your computer and use it in GitHub Desktop.
Axalize Deploy Project

Deploy dự án Ethos

Ethos trên production không sử dụng git để quản lý code mà dùng RSync để push code

Để deploy code lên Ethos cần thực hiện:

  • composer install trên local
  • sync lên server production

sau khi đảm bảo code trên local là mới nhất thì có thể chạy lênh dưới đây.

Chú ý ~/.ssh/axalize/ethos_production là đường dẫn đến file key của server

rsync --progress -avzh --exclude='.git/' --exclude='deploy.sh' --exclude='.env' --exclude='.editorconfig' --exclude='.git*' --exclude='Dockerfile' --exclude='README.md' -e "ssh -i ~/.ssh/axalize/ethos_production" --rsync-path="sudo rsync" . [email protected]:/var/www/ethos
ssh -i ~/.ssh/axalize/ethos_production -t [email protected] "sudo chown -R www-data:www-data /var/www/ethos" 
ssh -i ~/.ssh/axalize/ethos_production -t [email protected] "sudo chmod -R 755 /var/www/ethos" 
ssh -i ~/.ssh/axalize/ethos_production -t [email protected] "sudo chmod -R 777 /var/www/ethos/storage" 
ssh -i ~/.ssh/axalize/ethos_production -t [email protected] "sudo chmod -R 777 /var/www/ethos/public"

Deploy dự án Oroshidama

Oroshidama trên production được dùng GIT. Để deploy cần pull code về, sử dụng kèm sudo nếu báo permision denice

sudo git pull origin master

các lệnh config:clear, config:cache, view:clear, view:cache, route:clear, route:cache sử dụng tùy trường hợp, nếu deploy thông thường thì không cân sử dụng

sau khi pull code và check code mới nhất đã có trên servercần đổi lại quyền và owner cho project

sudo chown -R apache:apache httpd/
sudo chmod 775 -R httpd/
sudo chmod 777 -R httpd/public/
sudo chmod 777 -R httpd/storage/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment