[release-notes/help-gnome-org] ci: update build script to build from tarball




commit a877c0661568ac9cbb835d9fe57406a41a9d8118
Author: Link Dupont <link sub-pop net>
Date:   Tue Aug 31 21:47:04 2021 -0400

    ci: update build script to build from tarball

 build.sh | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)
---
diff --git a/build.sh b/build.sh
index 30514cef..d3717f18 100644
--- a/build.sh
+++ b/build.sh
@@ -9,13 +9,22 @@ for branch in "${branches[@]}"; do
     if [ "${VERSION}" -ge 41 ]; then
         curl -L --output "release-notes-${VERSION}.zip" 
"https://gitlab.gnome.org/Teams/Engagement/release-notes/-/jobs/artifacts/${branch}/download?job=build";
         unzip "release-notes-${VERSION}.zip"
-        mkdir -p "${CI_PROJECT_DIR}/public/${VERSION}/"
-        pushd help-release-notes || exit 1
-        mapfile -t langs < <(ls -1 .)
-        for LANG in "${langs[@]}"; do
-            mkdir -p "${CI_PROJECT_DIR}/public/${VERSION}/${LANG}"
-            yelp-build html --output "${CI_PROJECT_DIR}/public/${VERSION}/${LANG}" "${LANG}/release-notes"
-        done
+        tar -xf "release-notes-${VERSION}.tar.gz"
+        mkdir -p "${CI_PROJECT_DIR}/output/"
+        mkdir -p "${CI_PROJECT_DIR}/public/"
+        pushd "release-notes-${VERSION}" || exit 1
+        while IFS= read -r -d '' LANG_DIR
+        do
+            LANG=$(basename "${LANG_DIR}")
+            yelp-build html --output "${CI_PROJECT_DIR}/output/" --path ./help/C "./help/${LANG}/"
+            if [ "${LANG}" == C ]; then
+                mv "${CI_PROJECT_DIR}/output" "${CI_PROJECT_DIR}/public/${VERSION}"
+            else
+                mv "${CI_PROJECT_DIR}/index.html"      
"${CI_PROJECT_DIR}/public/${VERSION}/index.html.${LANG}"
+                mv "${CI_PROJECT_DIR}/developers.html" 
"${CI_PROJECT_DIR}/public/${VERSION}/developers.html.${LANG}"
+                mv "${CI_PROJECT_DIR}/i18n.html"       
"${CI_PROJECT_DIR}/public/${VERSION}/i18n.html.${LANG}"
+            fi
+        done < <(find help/* -maxdepth 0 -type d -print0)
         popd || exit 1
     fi
 done


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]