parameters: (bucket_name, src, dst, headers={}, ignore=[])
docstring: Deploy a folder to S3, checking each file to see if it has changed.
docstring_summary: Deploy a folder to S3, checking each file to see if it has changed.
docstring_tokens: Deploy a folder to S3 checking each file to see if it has changed .
function: def deploy_folder(bucket_name, src, dst, headers={}, ignore=[]):
      """
      Deploy a folder to S3, checking each file to see if it has changed.
      """
      to_deploy = []
  
      for local_path, subdirs, filenames in os.walk(src, topdown=True):
          rel_path = os.path.relpath(local_path, src)
  
          for name in filenames:
              if name.startswith('.'):
                  continue
  
              src_path = os.path.join(local_path, name)
  
              skip = False
  
              for pattern in ignore:
                  if fnmatch(src_path, pattern):
                      skip = True
                      break
  
              if skip:
                  continue
  
              if rel_path == '.':
                  dst_path = os.path.join(dst, name)
              else:
                  dst_path = os.path.join(dst, rel_path, name)
  
              to_deploy.append((src_path, dst_path))
  
      if bucket_name == app_config.STAGING_S3_BUCKET:
          public = False
      else:
          public = True
      bucket = utils.get_bucket(bucket_name)
      logger.info(dst)
      for src, dst in to_deploy:
          deploy_file(bucket, src, dst, headers, public=public)
function_tokens: def deploy_folder ( bucket_name , src , dst , headers = { } , ignore = [ ] ) : to_deploy = [ ] for local_path , subdirs , filenames in os . walk ( src , topdown = True ) : rel_path = os . path . relpath ( local_path , src ) for name in filenames : if name . startswith ( '.' ) : continue src_path = os . path . join ( local_path , name ) skip = False for pattern in ignore : if fnmatch ( src_path , pattern ) : skip = True break if skip : continue if rel_path == '.' : dst_path = os . path . join ( dst , name ) else : dst_path = os . path . join ( dst , rel_path , name ) to_deploy . append ( ( src_path , dst_path ) ) if bucket_name == app_config . STAGING_S3_BUCKET : public = False else : public = True bucket = utils . get_bucket ( bucket_name ) logger . info ( dst ) for src , dst in to_deploy : deploy_file ( bucket , src , dst , headers , public = public )