mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
Merge pull request #39094 from vikram-redhat/enterprise-4.10
[enterprise-4.10] moved topic map
This commit is contained in:
2
Gemfile
2
Gemfile
@@ -1,4 +1,4 @@
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem 'ascii_binder', '~>0.1.5'
|
||||
gem 'ascii_binder', '~>1.0'
|
||||
|
||||
|
||||
21
build.py
21
build.py
@@ -22,6 +22,7 @@ import sys
|
||||
import time
|
||||
import yaml
|
||||
import requests
|
||||
import tempfile
|
||||
|
||||
from aura import cli
|
||||
|
||||
@@ -151,9 +152,25 @@ def find_build_config_file():
|
||||
"""
|
||||
Finds the build config file to use, as it might be _topic_map.yml or _build_cfg.yml
|
||||
"""
|
||||
config = os.path.abspath(os.path.join(CLONE_DIR, "_topic_map.yml"))
|
||||
|
||||
# updated 23rd Nov to support files in _topic_maps folder
|
||||
|
||||
# load everything from the _topic_maps folder
|
||||
file_list = os.listdir(os.path.join(CLONE_DIR, "_topic_maps"))
|
||||
|
||||
# create a temp file combining all values from that folder
|
||||
# don't delete it immediately, and give it a suffix of swp which makes it ignored by git
|
||||
with tempfile.NamedTemporaryFile(dir=CLONE_DIR, delete=False, suffix=".swp") as tmp:
|
||||
for f in file_list:
|
||||
with open(os.path.join(CLONE_DIR, "_topic_maps", f), "rb") as infile:
|
||||
tmp.write(infile.read())
|
||||
|
||||
config = os.path.abspath(tmp.name)
|
||||
log.info(config)
|
||||
|
||||
# backup look for a single _topic_map in the cloned directory
|
||||
if not os.path.isfile(config):
|
||||
config = os.path.abspath(os.path.join(CLONE_DIR, "_build_cfg.yml"))
|
||||
config = os.path.abspath(os.path.join(CLONE_DIR, "_topic_map.yml"))
|
||||
|
||||
return config
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ import sys
|
||||
import time
|
||||
import yaml
|
||||
import requests
|
||||
import tempfile
|
||||
|
||||
from aura import cli
|
||||
|
||||
@@ -144,13 +145,28 @@ def find_build_config_file():
|
||||
"""
|
||||
Finds the build config file to use, as it might be _topic_map.yml or _build_cfg.yml
|
||||
"""
|
||||
config = os.path.abspath(os.path.join(CLONE_DIR, "_topic_map.yml"))
|
||||
|
||||
# updated 23rd Nov to support files in _topic_maps folder
|
||||
|
||||
# load everything from the _topic_maps folder
|
||||
file_list = os.listdir(os.path.join(CLONE_DIR, "_topic_maps"))
|
||||
|
||||
# create a temp file combining all values from that folder
|
||||
# don't delete it immediately, and give it a suffix of swp which makes it ignored by git
|
||||
with tempfile.NamedTemporaryFile(dir=CLONE_DIR, delete=False, suffix=".swp") as tmp:
|
||||
for f in file_list:
|
||||
with open(os.path.join(CLONE_DIR, "_topic_maps", f), "rb") as infile:
|
||||
tmp.write(infile.read())
|
||||
|
||||
config = os.path.abspath(tmp.name)
|
||||
log.info(config)
|
||||
|
||||
# backup look for a single _topic_map in the cloned directory
|
||||
if not os.path.isfile(config):
|
||||
config = os.path.abspath(os.path.join(CLONE_DIR, "_build_cfg.yml"))
|
||||
config = os.path.abspath(os.path.join(CLONE_DIR, "_topic_map.yml"))
|
||||
|
||||
return config
|
||||
|
||||
|
||||
def parse_build_config(config):
|
||||
"""
|
||||
Parses the build config and returns a tree based structure for the config.
|
||||
|
||||
Reference in New Issue
Block a user