Skip to content

Commit

Permalink
fix(sync): issue with build staging sync procedure on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
edvald committed Nov 11, 2019
1 parent d5f82b5 commit 785d54f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,9 @@ jobs:
- run:
name: Override build ID
command: $env:CIRCLE_BUILD_NUM = "$env:CIRCLE_BUILD_NUM-win"
- run:
name: Build demo-project
command: .\garden-service\dist\windows-amd64\garden.exe build --root .\examples\demo-project\ --logger-type basic --env testing
- run:
name: Deploy demo-project
command: .\garden-service\dist\windows-amd64\garden.exe deploy --root .\examples\demo-project\ --logger-type basic --env testing
Expand Down
7 changes: 7 additions & 0 deletions garden-service/src/build-dir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ export class BuildDir {
// --exclude is required for modules where the module and project are in the same directory
const syncOpts = ["-rptgo", `--exclude=${this.buildDirPath}`, "--ignore-missing-args"]

// We have noticed occasional issues with the default rsync behavior of creating temp files when copying
// when using Windows/cwRsync. This workaround appears to do the trick, but is less optimal so we don't apply
// it for other platforms.
if (process.platform === "win32") {
syncOpts.push("--inplace")
}

let logMsg =
`Syncing ${module.version.files.length} files from ` +
`${relative(this.projectRoot, sourcePath)} to ${relative(this.projectRoot, destinationPath)}`
Expand Down

0 comments on commit 785d54f

Please sign in to comment.