[smc-discuss] [Git][smc/smc-website][4-font-download-automation] Make URLs configurable

Balasankar "Balu" C gitlab at mg.gitlab.com
Sat Oct 6 09:37:52 PDT 2018


Balasankar "Balu" C pushed to branch 4-font-download-automation at SMC / SMC Website


Commits:
303c15b1 by Balasankar "Balu" C at 2018-10-06T13:55:56Z
Make URLs configurable

- - - - -


1 changed file:

- update_fonts.sh


Changes:

=====================================
update_fonts.sh
=====================================
@@ -1,16 +1,23 @@
+#!/bin/bash
+
+FONTS_URL=${FONTS_URL:-"smc/fonts"}
+# Convert slash to %2F
+FONTS_SLUG=${FONTS_URL/\//%2F}
+
 mkdir -p downloads/fonts
 cd downloads/fonts || exit
 fonts=(anjalioldlipi rachana meera manjari raghumalayalamsans dyuthi keraleeyam uroob chilanka karumbi)
 for font in "${fonts[@]}"; do
         mkdir "$font"
         cd "$font" || exit
-        version=$(curl -sSL "https://gitlab.com/api/v4/projects/smc%2Ffonts%2F${font}/repository/tags"| jq '.[0]["name"]' | tr -d '"')
-        wget "https://gitlab.com/smc/fonts/${font}/-/jobs/artifacts/${version}/download?job=build-tag" -O artifacts.zip
-        unzip artifacts.zip
+        version=$(curl -sSL "https://gitlab.com/api/v4/projects/${FONTS_SLUG}%2F${font}/repository/tags"| jq '.[].name' | grep -i version | sort -V | tail -1 | tr -d '"')
+        echo "$font : $version"
+        wget -q "https://gitlab.com/${FONTS_URL}/${font}/-/jobs/artifacts/${version}/download?job=build-tag" -O artifacts.zip
+        unzip -q artifacts.zip
         rm artifacts.zip
         mv build/* .
         rm -rf build
         cd ../ || exit
 done
 
-zip -r fonts-smc.zip . -i "*.ttf" -j
+zip -qr fonts-smc.zip . -i "*.ttf" -j



View it on GitLab: https://gitlab.com/smc/smc-website/commit/303c15b19d44553cbdc03da7fb285bb310b53d2a

-- 
View it on GitLab: https://gitlab.com/smc/smc-website/commit/303c15b19d44553cbdc03da7fb285bb310b53d2a
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.smc.org.in/pipermail/discuss-smc.org.in/attachments/20181006/fd147338/attachment-0002.html>


More information about the discuss mailing list