code: def build(bucket_name, version, force, verbose):
      
      if verbose:
          log.setLevel('DEBUG')
  
      if not version:
          version = setuptools_scm.get_version()
  
      release = "dev" if "dev" in version else "release"
      tarball = TARBALL_FORMAT.format(version)
      tarball_path = os.path.join(tempfile.gettempdir(), tarball)
      s3_key = os.path.join(release, tarball)
  
      try:
          run('npm i')
          run('./node_modules/.bin/gulp build.prod')
  
      except ExecutionError:
          log.exception('Failed executing command')
          return
  
      log.debug('Creating archive')
      tar = tarfile.open(tarball_path, "w:gz")
      for root, dirnames, filenames in os.walk('dist'):
          for f in filenames:
              tar.add(os.path.join(root, f), recursive=False, filter=strip_path)
      tar.close()
  
      log.debug('Uploading {} to s3://{}/{}'.format(tarball, bucket_name, s3_key))
      try:
          bucket = get_bucket_resource(bucket_name)
  
          if s3_file_exists(bucket, s3_key) and not force:
              log.error('File already exists in S3, use --force to overwrite')
              return
  
          bucket.upload_file(tarball_path, os.path.join(release, tarball))
      except ClientError:
          log.exception('AWS API failure')
docs: Build and upload a new tarball
  
      Args:
          bucket_name (str): Name of the bucket to upload to
          version (str): Override build version. Defaults to using SCM based versioning (git tags)
          force (bool): Overwrite existing files in S3, if present
          verbose (bool): Verbose output