Skip to content

Instantly share code, notes, and snippets.

@ngocquyhoang
Created August 30, 2019 08:43
Show Gist options
  • Select an option

  • Save ngocquyhoang/4665af1d34b92fff5f736d71ff740fc8 to your computer and use it in GitHub Desktop.

Select an option

Save ngocquyhoang/4665af1d34b92fff5f736d71ff740fc8 to your computer and use it in GitHub Desktop.

Revisions

  1. ngocquyhoang revised this gist Aug 30, 2019. No changes.
  2. ngocquyhoang created this gist Aug 30, 2019.
    20 changes: 20 additions & 0 deletions ethos.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    ## 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"
    ```
    18 changes: 18 additions & 0 deletions oroshidama.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    ## 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/
    ```