commit: 5a7d7f4d81afea195ac14e54d92231f9fa6cbf12
parent: f02f0a2973c920811320133d9199a0eb8714660c
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sun, 3 Feb 2019 15:13:16 +0100
download-mastofe-build.sh: New script
Diffstat:
1 file changed, 28 insertions(+), 0 deletions(-)
diff --git a/download-mastofe-build.sh b/download-mastofe-build.sh
@@ -0,0 +1,28 @@
+#!/bin/sh -x
+project_id="74"
+project_branch="rebase%2Fglitch-soc"
+
+last_modified="$(curl -s -I 'https://git.pleroma.social/api/v4/projects/'${project_id}'/jobs/artifacts/'${project_branch}'/download?job=build' | grep '^Last-Modified:' | cut -d: -f2-)"
+
+artifact="mastofe_${last_modified}.zip"
+
+if [[ -e mastofe.timestamp ]] && [[ "${last_modified}" != "" ]]
+then
+ if [[ "$(cat mastofe.timestamp)" == "${last_modified}" ]]
+ then
+ echo "MastoFE is up-to-date, exiting…"
+ exit 0
+ fi
+fi
+
+curl -c "https://git.pleroma.social/api/v4/projects/${project_id}/jobs/artifacts/${project_branch}/download?job=build" -o "${artifact}" || exit
+
+rm -fr priv/static/sw.js priv/static/packs || exit
+unzip "${artifact}" || exit
+
+cp public/assets/sw.js priv/static/sw.js || exit
+cp -r public/packs priv/static/packs || exit
+
+echo "${last_modified}" > mastofe.timestamp
+rm -fr public
+rm -i "${artifact}"