Improve deployment robustness with consistent robocopy usage (#284)
Commit: 4438a7e3a9d26e11cf4c41af140590f5b5ba35c2
Date: 2025-09-02 22:07:34 +0200
Author: PascalHavelange
Commit Message
Improve deployment robustness with consistent robocopy usage (#284)
# Improve deployment robustness with consistent robocopy usage
## Summary
Replace Move-Item with robocopy for moving current production to old directory, ensuring consistent and robust file operations throughout the deployment process.
## Details
- Created local PowerShell function `Invoke-RobocopyMirror` to eliminate code duplication
- Both "move production to old" and "copy staging to production" operations now use robocopy
- Proper exit code handling for all robocopy operations (exit codes 0-2 are success)
- Consistent logging with timestamped log files for troubleshooting
- More robust handling of large directories and locked files
## Benefits
- **Consistency**: All file operations use the same robust mechanism
- **Reliability**: robocopy handles locked files and permissions better than Move-Item
- **Maintainability**: Single function reduces code duplication
- **Troubleshooting**: Comprehensive logging for all operations
- **Performance**: More efficient for large directory operations
## Testing
- Deployment workflow logic verified
- Error handling maintains proper exit codes
- Log files generated with descriptive names
This change ensures the deployment process is more reliable and consistent across all file operations.
Co-authored-by: Pascal HAVELANGE <havelangep@hotmail.com>
Files Changed
- 📝 Modified:
.github/workflows/deploy-mwnf-svr.yml
Links
This documentation was automatically generated from Git commit data.