Modify rsync filter to retain output across runs
This commit is contained in:
		@@ -654,7 +654,6 @@ function kube::build::stop_rsyncd_container() {
 | 
				
			|||||||
function kube::build::rsync {
 | 
					function kube::build::rsync {
 | 
				
			||||||
  local -a rsync_opts=(
 | 
					  local -a rsync_opts=(
 | 
				
			||||||
    --archive
 | 
					    --archive
 | 
				
			||||||
    --prune-empty-dirs
 | 
					 | 
				
			||||||
    --password-file="${LOCAL_OUTPUT_BUILD_CONTEXT}/rsyncd.password"
 | 
					    --password-file="${LOCAL_OUTPUT_BUILD_CONTEXT}/rsyncd.password"
 | 
				
			||||||
  )
 | 
					  )
 | 
				
			||||||
  if (( ${KUBE_VERBOSE} >= 6 )); then
 | 
					  if (( ${KUBE_VERBOSE} >= 6 )); then
 | 
				
			||||||
@@ -679,16 +678,19 @@ function kube::build::sync_to_container() {
 | 
				
			|||||||
  # directory and generated files. The '- /' filter prevents rsync
 | 
					  # directory and generated files. The '- /' filter prevents rsync
 | 
				
			||||||
  # from trying to set the uid/gid/perms on the root of the sync tree.
 | 
					  # from trying to set the uid/gid/perms on the root of the sync tree.
 | 
				
			||||||
  # As an exception, we need to sync generated files in staging/, because
 | 
					  # As an exception, we need to sync generated files in staging/, because
 | 
				
			||||||
  # they will not be re-generated by 'make'.
 | 
					  # they will not be re-generated by 'make'. Note that the 'H' filtered files
 | 
				
			||||||
 | 
					  # are hidden from rsync so they will be deleted in the target container if
 | 
				
			||||||
 | 
					  # they exist. This will allow them to be re-created in the container if
 | 
				
			||||||
 | 
					  # necessary.
 | 
				
			||||||
  kube::build::rsync \
 | 
					  kube::build::rsync \
 | 
				
			||||||
    --delete \
 | 
					    --delete \
 | 
				
			||||||
    --filter='- /.git/' \
 | 
					    --filter='H /.git/' \
 | 
				
			||||||
    --filter='- /.make/' \
 | 
					    --filter='- /.make/' \
 | 
				
			||||||
    --filter='- /_tmp/' \
 | 
					    --filter='- /_tmp/' \
 | 
				
			||||||
    --filter='- /_output/' \
 | 
					    --filter='- /_output/' \
 | 
				
			||||||
    --filter='- /' \
 | 
					    --filter='- /' \
 | 
				
			||||||
    --filter='- zz_generated.*' \
 | 
					    --filter='H zz_generated.*' \
 | 
				
			||||||
    --filter='- generated.proto' \
 | 
					    --filter='H generated.proto' \
 | 
				
			||||||
    "${KUBE_ROOT}/" "rsync://k8s@${KUBE_RSYNC_ADDR}/k8s/"
 | 
					    "${KUBE_ROOT}/" "rsync://k8s@${KUBE_RSYNC_ADDR}/k8s/"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  kube::build::stop_rsyncd_container
 | 
					  kube::build::stop_rsyncd_container
 | 
				
			||||||
@@ -714,6 +716,7 @@ function kube::build::copy_output() {
 | 
				
			|||||||
  # We are looking to copy out all of the built binaries along with various
 | 
					  # We are looking to copy out all of the built binaries along with various
 | 
				
			||||||
  # generated files.
 | 
					  # generated files.
 | 
				
			||||||
  kube::build::rsync \
 | 
					  kube::build::rsync \
 | 
				
			||||||
 | 
					    --prune-empty-dirs \
 | 
				
			||||||
    --filter='- /_temp/' \
 | 
					    --filter='- /_temp/' \
 | 
				
			||||||
    --filter='+ /vendor/' \
 | 
					    --filter='+ /vendor/' \
 | 
				
			||||||
    --filter='+ /Godeps/' \
 | 
					    --filter='+ /Godeps/' \
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user