docs build fixes

This commit is contained in:
Ivan Blinkov 2019-12-10 11:15:38 +03:00
parent d5a0833595
commit f9fe0577c4
2 changed files with 6 additions and 3 deletions

View File

@ -45,6 +45,9 @@ def build_for_lang(lang, args):
os.environ['SINGLE_PAGE'] = '0'
config_path = os.path.join(args.docs_dir, 'toc_%s.yml' % lang)
if args.is_stable_release and not os.path.exists(config_path):
logging.warn('Skipping %s docs, because %s does not exist' % (lang, config_path))
return
try:
theme_cfg = {
@ -249,6 +252,7 @@ if __name__ == '__main__':
arg_parser.add_argument('--output-dir', default='build')
arg_parser.add_argument('--enable-stable-releases', action='store_true')
arg_parser.add_argument('--version-prefix', type=str, default='')
arg_parser.add_argument('--is-stable-release', action='store_true')
arg_parser.add_argument('--skip-single-page', action='store_true')
arg_parser.add_argument('--skip-pdf', action='store_true')
arg_parser.add_argument('--skip-website', action='store_true')
@ -260,8 +264,6 @@ if __name__ == '__main__':
from github import choose_latest_releases
args.stable_releases = choose_latest_releases() if args.enable_stable_releases else []
logging.basicConfig(
level=logging.DEBUG if args.verbose else logging.INFO,

View File

@ -15,7 +15,7 @@ def choose_latest_releases():
candidates = requests.get('https://api.github.com/repos/ClickHouse/ClickHouse/tags?per_page=100').json()
for tag in candidates:
name = tag.get('name', '')
if 'v18' in name or 'stable' not in name:
if ('v18' in name) or ('stable' not in name) or ('prestable' in name):
continue
major_version = '.'.join((name.split('.', 2))[:2])
if major_version not in seen:
@ -33,6 +33,7 @@ def process_release(args, callback, release):
tar.extractall(base_dir)
args = copy.deepcopy(args)
args.version_prefix = name
args.is_stable_release = True
args.docs_dir = os.path.join(base_dir, os.listdir(base_dir)[0], 'docs')
callback(args)