2 # Pleroma: A lightweight social networking server
3 # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
4 # SPDX-License-Identifier: AGPL-3.0-only
6 project_branch
="rebase/glitch-soc"
7 static_dir
="instance/static"
9 # project_branch="pleroma"
10 # static_dir="priv/static"
12 if [ ! -d "${static_dir}" ]
14 echo "Error: ${static_dir} directory is missing, are you sure you are running this script at the root of pleroma’s repository?"
18 last_modified
="$(curl --fail -s -I 'https://git.pleroma.social/api/v4/projects/'${project_id}'/jobs/artifacts/'${project_branch}'/download?job=build' | grep '^Last-Modified:' | cut -d: -f2-)"
20 echo "branch:${project_branch}"
21 echo "Last-Modified:${last_modified}"
23 artifact
="mastofe.zip"
25 if [ "${last_modified}x" = "x" ]
27 echo "ERROR: Couldn't get the modification date of the latest build archive, maybe it expired, exiting..."
31 if [ -e mastofe.timestamp
] && [ "$(cat mastofe.timestamp)" = "${last_modified}" ]
33 echo "MastoFE is up-to-date, exiting..."
37 curl
--fail -c - "https://git.pleroma.social/api/v4/projects/${project_id}/jobs/artifacts/${project_branch}/download?job=build" -o "${artifact}" || exit
39 # TODO: Update the emoji as well
40 rm -fr "${static_dir}/sw.js" "${static_dir}/packs" || exit
41 unzip -q "${artifact}" || exit
43 cp public
/assets
/sw.js
"${static_dir}/sw.js" || exit
44 cp -r public
/packs
"${static_dir}/packs" || exit
46 echo "${last_modified}" > mastofe.timestamp