Try to fix docs build (#8113)

This commit is contained in:
Ivan Blinkov 2019-12-10 11:17:26 +03:00 committed by GitHub
parent 9534eb32a0
commit 16f677d0c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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' os.environ['SINGLE_PAGE'] = '0'
config_path = os.path.join(args.docs_dir, 'toc_%s.yml' % lang) 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: try:
theme_cfg = { theme_cfg = {
@ -249,6 +252,7 @@ if __name__ == '__main__':
arg_parser.add_argument('--output-dir', default='build') arg_parser.add_argument('--output-dir', default='build')
arg_parser.add_argument('--enable-stable-releases', action='store_true') arg_parser.add_argument('--enable-stable-releases', action='store_true')
arg_parser.add_argument('--version-prefix', type=str, default='') 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-single-page', action='store_true')
arg_parser.add_argument('--skip-pdf', action='store_true') arg_parser.add_argument('--skip-pdf', action='store_true')
arg_parser.add_argument('--skip-website', 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 from github import choose_latest_releases
args.stable_releases = choose_latest_releases() if args.enable_stable_releases else [] args.stable_releases = choose_latest_releases() if args.enable_stable_releases else []
logging.basicConfig( logging.basicConfig(
level=logging.DEBUG if args.verbose else logging.INFO, 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() candidates = requests.get('https://api.github.com/repos/ClickHouse/ClickHouse/tags?per_page=100').json()
for tag in candidates: for tag in candidates:
name = tag.get('name', '') 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 continue
major_version = '.'.join((name.split('.', 2))[:2]) major_version = '.'.join((name.split('.', 2))[:2])
if major_version not in seen: if major_version not in seen:
@ -33,6 +33,7 @@ def process_release(args, callback, release):
tar.extractall(base_dir) tar.extractall(base_dir)
args = copy.deepcopy(args) args = copy.deepcopy(args)
args.version_prefix = name args.version_prefix = name
args.is_stable_release = True
args.docs_dir = os.path.join(base_dir, os.listdir(base_dir)[0], 'docs') args.docs_dir = os.path.join(base_dir, os.listdir(base_dir)[0], 'docs')
callback(args) callback(args)