mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Merge pull request #9254 from justinsb/aws_sync_to_s3
AWS: Use s3 sync to optimize upload to s3 when nothing changed
This commit is contained in:
		@@ -298,15 +298,20 @@ function upload-server-tars() {
 | 
			
		||||
 | 
			
		||||
  local -r staging_path="devel"
 | 
			
		||||
 | 
			
		||||
  echo "+++ Staging server tars to S3 Storage: ${AWS_S3_BUCKET}/${staging_path}"
 | 
			
		||||
  local -r local_dir="${KUBE_TEMP}/s3/"
 | 
			
		||||
  mkdir ${local_dir}
 | 
			
		||||
 | 
			
		||||
  echo "+++ Staging server tars to S3 Storage: ${AWS_S3_BUCKET}/${staging_path}"
 | 
			
		||||
  local server_binary_path="${staging_path}/${SERVER_BINARY_TAR##*/}"
 | 
			
		||||
  aws s3 cp "${SERVER_BINARY_TAR}" "s3://${AWS_S3_BUCKET}/${server_binary_path}"
 | 
			
		||||
  cp -a "${SERVER_BINARY_TAR}" ${local_dir}
 | 
			
		||||
  cp -a "${SALT_TAR}" ${local_dir}
 | 
			
		||||
 | 
			
		||||
  aws s3 sync --exact-timestamps ${local_dir} "s3://${AWS_S3_BUCKET}/${staging_path}/"
 | 
			
		||||
 | 
			
		||||
  aws s3api put-object-acl --bucket ${AWS_S3_BUCKET} --key "${server_binary_path}" --grant-read 'uri="http://acs.amazonaws.com/groups/global/AllUsers"'
 | 
			
		||||
  SERVER_BINARY_TAR_URL="${s3_url_base}/${AWS_S3_BUCKET}/${server_binary_path}"
 | 
			
		||||
 | 
			
		||||
  local salt_tar_path="${staging_path}/${SALT_TAR##*/}"
 | 
			
		||||
  aws s3 cp "${SALT_TAR}" "s3://${AWS_S3_BUCKET}/${salt_tar_path}"
 | 
			
		||||
  aws s3api put-object-acl --bucket ${AWS_S3_BUCKET} --key "${salt_tar_path}" --grant-read 'uri="http://acs.amazonaws.com/groups/global/AllUsers"'
 | 
			
		||||
  SALT_TAR_URL="${s3_url_base}/${AWS_S3_BUCKET}/${salt_tar_path}"
 | 
			
		||||
}
 | 
			
		||||
@@ -441,10 +446,10 @@ function kube-up {
 | 
			
		||||
 | 
			
		||||
  find-release-tars
 | 
			
		||||
 | 
			
		||||
  upload-server-tars
 | 
			
		||||
 | 
			
		||||
  ensure-temp-dir
 | 
			
		||||
 | 
			
		||||
  upload-server-tars
 | 
			
		||||
 | 
			
		||||
  ensure-iam-profiles
 | 
			
		||||
 | 
			
		||||
  get-password
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user