From 7aacd30a3f64f562913a952d2fd982c3a7e96aeb Mon Sep 17 00:00:00 2001 From: Vikram Goyal Date: Mon, 22 Nov 2021 22:19:28 +1000 Subject: [PATCH 1/4] [enterprise-4.10] moved topic map --- _topic_map.yml => _topic_maps/_topic_map.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename _topic_map.yml => _topic_maps/_topic_map.yml (100%) diff --git a/_topic_map.yml b/_topic_maps/_topic_map.yml similarity index 100% rename from _topic_map.yml rename to _topic_maps/_topic_map.yml From 9706dc331a06e00a30ec315219e0bf266596c342 Mon Sep 17 00:00:00 2001 From: Vikram Goyal Date: Tue, 23 Nov 2021 08:11:57 +1000 Subject: [PATCH 2/4] Updated build.py for Travis Check --- build.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/build.py b/build.py index 44fb9b4279..e6b46f8442 100755 --- a/build.py +++ b/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 From c91afb6117b308c2e54ef2972f06b5a606d59aae Mon Sep 17 00:00:00 2001 From: Vikram Goyal Date: Tue, 23 Nov 2021 09:21:03 +1000 Subject: [PATCH 3/4] Update build_for_portal for publishing books to portal --- build_for_portal.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/build_for_portal.py b/build_for_portal.py index 8f3614ff21..167d4b748d 100644 --- a/build_for_portal.py +++ b/build_for_portal.py @@ -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. From 407e40ba482cc8d6cf2e1cee4c4ec32961dda5af Mon Sep 17 00:00:00 2001 From: Vikram Goyal Date: Tue, 23 Nov 2021 16:27:14 +1000 Subject: [PATCH 4/4] update gemfile --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index b79fdd8e16..e3d79c72e7 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ source "https://rubygems.org" -gem 'ascii_binder', '~>0.1.5' +gem 'ascii_binder', '~>1.0'