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




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

    ci: update build script to build from tarball

 .gitlab-ci.yml |  2 +-
 build.sh       | 19 ++++++++++++-------
 2 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index fc66d4aa..712b6397 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -13,7 +13,7 @@ pages:
   before_script:
     - dnf update -y --nogpgcheck && dnf install -y --nogpgcheck $DEPENDENCIES
   stage: deploy
-  script: sh -xe ./build.sh
+  script: bash -xe ./build.sh
   artifacts:
     paths:
       - public
diff --git a/build.sh b/build.sh
index 30514cef..5cf3cf7f 100644
--- a/build.sh
+++ b/build.sh
@@ -9,13 +9,18 @@ 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}/public/${VERSION}"
+        pushd "release-notes-${VERSION}" || exit 1
+        while IFS= read -r -d '' LANG_DIR
+        do
+            LANG=$(basename "${LANG_DIR}")
+            OUTDIR="${CI_PROJECT_DIR}/public/${VERSION}/${LANG}/"
+            if [ "${LANG}" == C ]; then
+                OUTDIR="${CI_PROJECT_DIR}/public/${VERSION}/"
+            fi
+            yelp-build html --output "${OUTDIR}" --path ./help/C "./help/${LANG}/"
+        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]