docs: def main():
      """Run chartpress"""
      argparser = argparse.ArgumentParser(description=__doc__)
  
      argparser.add_argument('--commit-range',
          help='Range of commits to consider when building images')
      argparser.add_argument('--push', action='store_true',
          help='push built images to docker hub')
      argparser.add_argument('--publish-chart', action='store_true',
          help='publish updated chart to gh-pages')
      argparser.add_argument('--tag', default=None,
          help='Use this tag for images & charts')
      argparser.add_argument('--extra-message', default='',
          help='extra message to add to the commit message when publishing charts')
      argparser.add_argument('--image-prefix', default=None,
          help='override image prefix with this value')
  
      args = argparser.parse_args()
  
      with open('chartpress.yaml') as f:
          config = yaml.load(f)
  
      for chart in config['charts']:
          chart_paths = ['.'] + list(chart.get('paths', []))
  
          version = args.tag
          if version:
              # version of the chart shouldn't have leading 'v' prefix
              # if tag is of the form 'v1.2.3'
              version = version.lstrip('v')
          chart_version = build_chart(chart['name'], paths=chart_paths, version=version)
  
          if 'images' in chart:
              image_prefix = args.image_prefix if args.image_prefix is not None else chart['imagePrefix']
              value_mods = build_images(
                  prefix=image_prefix,
                  images=chart['images'],
                  tag=args.tag,
                  commit_range=args.commit_range,
                  push=args.push,
                  # exclude `-<hash>` from chart_version prefix for images
                  chart_version=chart_version.split('-', 1)[0],
              )
              build_values(chart['name'], value_mods)
  
          if args.publish_chart:
              publish_pages(chart['name'],
                  paths=chart_paths,
                  git_repo=chart['repo']['git'],
                  published_repo=chart['repo']['published'],
                  extra_message=args.extra_message,
              )