mrsixw / concourse-rsync-resource

concourse.ci resource for persisting build artifacts on a shared storage location with rsync and ssh.
Apache License 2.0
18 stars 40 forks source link

Unable to deploy initial revision to empty directory #14

Closed jamie-pate closed 3 years ago

jamie-pate commented 3 years ago

If the destination is empty (in this case I'm also using disable_version_path: true) then the resource errors because there are no existing versions. This make it impossible to deploy to an empty directory.

rsync -Pav -e 'ssh -i ~/.ssh/server_key -p 22' user@10.x.x.x:/var/www/deploy/* /tmp/build/get
receiving incremental file list
rsync: link_stat "/var/www/deploy/*" failed: No such file or directory (2)

sent 8 bytes  received 88 bytes  192.00 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1650) [Receiver=3.1.2]
rsync: [Receiver] write error: Broken pipe (32)
Failed to rsync /var/www/deploy to /tmp/build/get

Maybe there is some rsync flag to fix this? not sure.

Workaround: add a placeholder file 'empty' so that some base 'version' is found.

jamie-pate commented 3 years ago

Actually on closer inspection it does 'put' before 'get' so it seems like my 'put' is failing...

Seems like I added rsync_opts '--omit-dir-times' but also need the default -Pav flags (docs should be clarified?)