From 6a36b0cc4950f5cfb97b8f0341b81045218fb6c6 Mon Sep 17 00:00:00 2001 From: Francois Andrieu Date: Feb 11 2021 13:06:16 +0000 Subject: [PATCH 1/3] log stderr on exception --- diff --git a/build_tm.py b/build_tm.py index 8aa37e7..ca99e42 100755 --- a/build_tm.py +++ b/build_tm.py @@ -150,6 +150,7 @@ def process_compendium(langfiles, dest): subprocess.run(command, check=True, cwd=tmp, capture_output=True) except subprocess.CalledProcessError as e: log.error("Error with msguniq {i}, error: {e}".format(i=i, e=e)) + log.error(e.stderr.decode('utf-8')) count += 1 @@ -166,6 +167,7 @@ def process_compendium(langfiles, dest): subprocess.run(command, check=True, cwd=tmp, capture_output=True) except subprocess.CalledProcessError: log.error(" msgcat exception...") + log.error(e.stderr.decode('utf-8')) def process_tmx(lang, source, dest): From 2b51dd1f148b0a5f69e2fc8b28a235395d94a847 Mon Sep 17 00:00:00 2001 From: Francois Andrieu Date: Feb 11 2021 13:07:43 +0000 Subject: [PATCH 2/3] fix exception handling --- diff --git a/build_tm.py b/build_tm.py index ca99e42..28d6c44 100755 --- a/build_tm.py +++ b/build_tm.py @@ -165,7 +165,7 @@ def process_compendium(langfiles, dest): try: subprocess.run(command, check=True, cwd=tmp, capture_output=True) - except subprocess.CalledProcessError: + except subprocess.CalledProcessError as e: log.error(" msgcat exception...") log.error(e.stderr.decode('utf-8')) From 62f9427ef65bb835dc7e475cb2a20553ff75c276 Mon Sep 17 00:00:00 2001 From: Francois Andrieu Date: Feb 11 2021 13:07:43 +0000 Subject: [PATCH 3/3] update Dockerfile for openshift use --- diff --git a/docker/Dockerfile.33 b/docker/Dockerfile.33 index b2c8d10..5736959 100644 --- a/docker/Dockerfile.33 +++ b/docker/Dockerfile.33 @@ -1,13 +1,18 @@ -FROM registry.fedoraproject.org/fedora:33 - -RUN dnf install -y lbzip2 unzip xz git cpio translate-toolkit dnf-plugins-core python3-pip rsync vim +FROM registry.fedoraproject.org/fedora:33 as builder +RUN dnf install -y lbzip2 unzip xz cpio dnf-plugins-core rsync python3-pip hugo gettext git COPY requirements.txt /src/requirements.txt + RUN pip install --no-cache -r /src/requirements.txt RUN pip install --upgrade https://github.com/WeblateOrg/language-data/archive/master.zip RUN pip install charamel RUN pip install git+https://github.com/WeblateOrg/translation-finder.git - -VOLUME /src -VOLUME /srpms +RUN mkdir -p /src/results /srpms; chmod g+rwX /srpms; chmod -R 1777 /tmp WORKDIR /src + +COPY *.py *.sh /src/ +COPY website /src/website/ +RUN chmod -R g+rwX /src/website +COPY templates /src/templates/ +VOLUME /src/results +ENV VERS f33 diff --git a/docker/Dockerfile.latest b/docker/Dockerfile.latest new file mode 100644 index 0000000..9f73dec --- /dev/null +++ b/docker/Dockerfile.latest @@ -0,0 +1,18 @@ +FROM registry.fedoraproject.org/fedora:34 as builder + +RUN dnf install -y lbzip2 unzip xz cpio dnf-plugins-core rsync python3-pip hugo gettext git +COPY requirements.txt /src/requirements.txt + +RUN pip install --no-cache -r /src/requirements.txt +RUN pip install --upgrade https://github.com/WeblateOrg/language-data/archive/master.zip +RUN pip install charamel +RUN pip install git+https://github.com/WeblateOrg/translation-finder.git +RUN mkdir -p /src/results /srpms; chmod g+rwX /srpms; chmod -R 1777 /tmp +WORKDIR /src + +COPY *.py *.sh /src/ +COPY website /src/website/ +RUN chmod -R g+rwX /src/website +COPY templates /src/templates/ +VOLUME /src/results +ENV VERS f34