From 2f1cd5d8d1786ae9e4d2bd288998c6d0deed8e5e Mon Sep 17 00:00:00 2001
From: Ziwei Wang <ziwei.wang@savoirfairelinux.com>
Date: Tue, 22 Aug 2023 13:36:03 -0400
Subject: [PATCH] Fix build

It now pulls translations before building html
The token is used for pulling. The value is provided in Jenkins config

Change-Id: I1aa41a7f4f10420ce465a81fba85c8c477b5c4cb
---
 Makefile                 | 8 ++++++--
 _build/Dockerfile.build  | 8 ++++++--
 _build/Jenkinsfile.build | 2 ++
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 94960983..e66264ed 100644
--- a/Makefile
+++ b/Makefile
@@ -55,11 +55,15 @@ po: gettext po-pre
 
 tx-pull:
 #	$(TX_CMD) pull -aft --minimum-perc=1
-	$(TX_CMD) pull -ftl $(LANGS_commasep)
+#   e.g. make tx-pull TRANSIFEX_API_TOKEN=<token_value>
+	$(TX_CMD) --token $(TRANSIFEX_API_TOKEN) pull -ftl $(LANGS_commasep)
 
 tx-push:
-	$(TX_CMD) push -s
+	$(TX_CMD) --token $(TRANSIFEX_API_TOKEN) push -s
 
+clean:
+	@echo "Removing $(OUT)"
+	rm -r $(OUT)
 deploy:
 	rsync $(RSYNC_OPTS) "$(OUT)"/html/ "$(RSYNC_DEST)"
 	for l in $(LANGS); do \
diff --git a/_build/Dockerfile.build b/_build/Dockerfile.build
index e8c958c9..c4483f0f 100644
--- a/_build/Dockerfile.build
+++ b/_build/Dockerfile.build
@@ -17,7 +17,11 @@ RUN groupadd -g "${GID}" jenkins && \
 
 USER jenkins
 
+RUN mkdir -p "/home/jenkins/.local/bin" && \
+    cd "/home/jenkins/.local/bin" && \
+    curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
+
 ENV PATH="/home/jenkins/.local/bin:${PATH}"
 
-RUN pip3 install --upgrade sphinx==5.3.0
-RUN pip3 install sphinx-intl==2.1.0 sphinx-rtd-theme==1.0.0 myst-parser==0.18.0
+RUN pip3 install --upgrade sphinx==6.2.1
+RUN pip3 install sphinx-intl==2.1.0 sphinx-rtd-theme==1.2.2 myst-parser==2.0.0
diff --git a/_build/Jenkinsfile.build b/_build/Jenkinsfile.build
index 707e20a4..4c496e21 100644
--- a/_build/Jenkinsfile.build
+++ b/_build/Jenkinsfile.build
@@ -82,6 +82,8 @@ pipeline {
                         stage('Build docs') {
                             run_cmd("""
                                 cd ${REPO_NAME}
+                                make gettext
+                                make tx-pull TRANSIFEX_API_TOKEN=${TRANSIFEX_API_TOKEN} 
                                 make html || true
                             """)
                         }
-- 
GitLab