Change deployment path to use temporary directory #19

Merged
rdenadai merged 1 commit from rdenadai-patch-9 into main 2025-10-18 19:00:59 +00:00
rdenadai commented 2025-10-18 19:00:53 +00:00 (Migrated from github.com)

Updated deployment process to first copy files to a temporary directory before moving them to the final location.

Updated deployment process to first copy files to a temporary directory before moving them to the final location.
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2025-10-18 19:01:30 +00:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment

Pull Request Overview

This PR modifies the deployment workflow to use a two-stage deployment process: first copying files to a temporary directory (/tmp/web_deploy/) via rsync, then moving them to the final location (/pds/web/) via SSH with elevated privileges.

Key Changes:

  • Updated rsync destination from /pds/web/ to /tmp/web_deploy/
  • Added a new deployment step to copy files from temporary to final location using sudo cp

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

## Pull Request Overview This PR modifies the deployment workflow to use a two-stage deployment process: first copying files to a temporary directory (`/tmp/web_deploy/`) via rsync, then moving them to the final location (`/pds/web/`) via SSH with elevated privileges. **Key Changes:** - Updated rsync destination from `/pds/web/` to `/tmp/web_deploy/` - Added a new deployment step to copy files from temporary to final location using `sudo cp` --- <sub>**Tip:** Customize your code reviews with copilot-instructions.md. <a href="/rdenadai/web.redecapivara.social/new/main/.github?filename=copilot-instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Create the file</a> or <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">learn how to get started</a>.</sub>
@ -47,4 +47,8 @@ jobs:
- name: Deploy dist/ to VM:/pds
run: |
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-10-18 19:01:30 +00:00

The /tmp/web_deploy/ directory may not exist on first deployment or after system reboot, causing rsync to fail. Add a step to create this directory first, or update the SSH command in the next step to include mkdir -p /tmp/web_deploy && before the copy operation.

        run: |
          ssh -p ${{ secrets.SSH_PORT }} -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no ${{ secrets.VM_USER }}@${{ secrets.VM_IP }} "mkdir -p /tmp/web_deploy"
The `/tmp/web_deploy/` directory may not exist on first deployment or after system reboot, causing rsync to fail. Add a step to create this directory first, or update the SSH command in the next step to include `mkdir -p /tmp/web_deploy &&` before the copy operation. ```suggestion run: | ssh -p ${{ secrets.SSH_PORT }} -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no ${{ secrets.VM_USER }}@${{ secrets.VM_IP }} "mkdir -p /tmp/web_deploy" ```
@ -51,0 +51,4 @@
- name: Move deployed files to final location
run: |
ssh -p ${{ secrets.SSH_PORT }} -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no ${{ secrets.VM_USER }}@${{ secrets.VM_IP }} "sudo cp -a /tmp/web_deploy/* /pds/web/"
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-10-18 19:01:29 +00:00

The cp command copies contents but doesn't handle deletion of files that were removed from the source. The original rsync --delete behavior is lost. Consider using rsync --delete in the final step as well, or add rm -rf /pds/web/* && before the cp command to maintain the delete synchronization behavior.

          ssh -p ${{ secrets.SSH_PORT }} -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no ${{ secrets.VM_USER }}@${{ secrets.VM_IP }} "sudo rsync -a --delete /tmp/web_deploy/ /pds/web/"
The `cp` command copies contents but doesn't handle deletion of files that were removed from the source. The original `rsync --delete` behavior is lost. Consider using `rsync --delete` in the final step as well, or add `rm -rf /pds/web/* &&` before the cp command to maintain the delete synchronization behavior. ```suggestion ssh -p ${{ secrets.SSH_PORT }} -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no ${{ secrets.VM_USER }}@${{ secrets.VM_IP }} "sudo rsync -a --delete /tmp/web_deploy/ /pds/web/" ```
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-10-18 19:01:30 +00:00

Using wildcard * in the cp command will fail if /tmp/web_deploy/ is empty or contains only hidden files (dotfiles). The command should copy the directory contents more reliably, for example: sudo rsync -a --delete /tmp/web_deploy/ /pds/web/

          ssh -p ${{ secrets.SSH_PORT }} -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no ${{ secrets.VM_USER }}@${{ secrets.VM_IP }} "sudo rsync -a --delete /tmp/web_deploy/ /pds/web/"
Using wildcard `*` in the cp command will fail if `/tmp/web_deploy/` is empty or contains only hidden files (dotfiles). The command should copy the directory contents more reliably, for example: `sudo rsync -a --delete /tmp/web_deploy/ /pds/web/` ```suggestion ssh -p ${{ secrets.SSH_PORT }} -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no ${{ secrets.VM_USER }}@${{ secrets.VM_IP }} "sudo rsync -a --delete /tmp/web_deploy/ /pds/web/" ```
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rdenadai/web.redecapivara.social!19
No description provided.