[library-web/oscp] lgo: Add entrypoint and release notes generator script
- From: Bartłomiej Piotrowski <bpiotrowski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [library-web/oscp] lgo: Add entrypoint and release notes generator script
- Date: Fri, 24 Jan 2020 11:19:10 +0000 (UTC)
commit f418ef7c42d76334b3460e161fd6187a7dfa59c8
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date: Fri Jan 24 12:19:03 2020 +0100
lgo: Add entrypoint and release notes generator script
lgo/Dockerfile | 4 ++++
lgo/entrypoint.sh | 8 ++++++++
lgo/release-notes-gen | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 62 insertions(+)
---
diff --git a/lgo/Dockerfile b/lgo/Dockerfile
index 8f96792..89f8b1a 100644
--- a/lgo/Dockerfile
+++ b/lgo/Dockerfile
@@ -13,3 +13,7 @@ RUN git clone https://github.com/GNOME/yelp-xsl /opt/yelp-xsl && \
cd /opt/yelp-xsl && ./autogen.sh && make -j2
ADD library-web.lgorc developer.lgorc /opt/
+ADD release-notes-gen /usr/local/bin/release-notes-gen
+ADD entrypoint.sh /entrypoint.sh
+
+ENTRYPOINT ["/entrypoint.sh"]
diff --git a/lgo/entrypoint.sh b/lgo/entrypoint.sh
new file mode 100755
index 0000000..940d66d
--- /dev/null
+++ b/lgo/entrypoint.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+set -x
+set -e
+
+/usr/local/bin/release-notes-gen
+/opt/lgo/src/lgo.py -vvvvv -c /opt/developer.lgorc
+/opt/lgo/src/lgo.py -vvvvv -c /opt/library-web.lgorc
diff --git a/lgo/release-notes-gen b/lgo/release-notes-gen
new file mode 100755
index 0000000..0f5a9f9
--- /dev/null
+++ b/lgo/release-notes-gen
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+DIR="$(basename "$(pwd)")"
+
+if [[ ! -d /data/cache/release-notes ]]; then
+ git clone https://gitlab.gnome.org/Teams/Engagement/release-notes.git \
+ /data/cache/release-notes
+fi
+
+cd /data/cache/release-notes
+git reset --hard
+git pull --rebase
+
+mapfile -t branches < <(git branch -r | cut -d/ -f2- | grep gnome-)
+
+for branch in ${branches[@]}; do
+ version="$(echo $branch | cut -d- -f2- | sed 's/-/./')"
+ TGZ="/data/extra-tarballs/release-notes-${version}.tar.gz"
+ if [[ -f $TGZ ]]; then
+ continue
+ fi
+
+ cd help
+ for LANG in $(find -maxdepth 1 -type d); do
+ PO_FILE="$LANG/$LANG.po"
+ if [ -e "$PO_FILE" ]; then
+ if [ -e C/index.page ]; then
+ msgfmt -o $LANG/$LANG.mo $PO_FILE
+ (cd $LANG && itstool -m $LANG.mo ../C/*.page)
+ else
+ for XML_FILE in C/*.xml; do
+ DEST="$LANG/$(basename $XML_FILE)"
+ BUILD=0
+ test -e "$DEST" || BUILD=1
+ test "$PO_FILE" -nt "$DEST" && BUILD=1
+ test "$XML_FILE" -nt "$DEST" && BUILD=1
+ if [ "$BUILD" = "1" ]
+ then
+ xml2po -e -p "$PO_FILE" "$XML_FILE" > "$DEST"
+ fi
+ done
+ fi
+ fi
+ done
+
+ cd ..
+
+ cd ..
+ tar czf "$TGZ" --exclude=".svn" --exclude=".git" "$DIR"
+done
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]