Mastodon customisations for queer.party
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

110 lines
3.4 KiB

#!/bin/sh
if [ "x$1" != "x" ]; then MASTODON_VERSION=$1; fi
if [ "x$MASTODON_VERSION" = "x" ]; then
echo "Please specify a version as the first argument or via env. var. MASTODON_VERSION">/dev/stderr
exit 1
fi
if [ "x$TAG_VERSION" = "x" ]; then TAG_VERSION=$MASTODON_VERSION; fi
if [ "x$DOCKER_UPSTREAM_VERSION" = "x" ]; then DOCKER_UPSTREAM_VERSION="v$MASTODON_VERSION"; fi
GIT_ARG_DEFAULTS="--recursive --jobs 4 --depth 1 --shallow-submodules --single-branch"
prep_untainted() {
git clone $GIT_ARG_DEFAULTS --branch v$MASTODON_VERSION https://commit.pup.cloud/mirrors/mastodon untainted
}
prep_tainted_meemu() {
git clone $GIT_ARG_DEFAULTS https://commit.pup.cloud/mirrors/mirror-meemudotorg-theemu modifications/theemu
}
prep_tainted_w95() {
git clone $GIT_ARG_DEFAULTS --branch theme_win95 https://commit.pup.cloud/mirrors/mirror-cybre-space modifications/w95
}
prep_tainted() {
mkdir deploy/fonts
mkdir deploy/images
cp -pr untainted tainted
mkdir modifications
prep_tainted_meemu
prep_tainted_w95
}
build_assets_meemu() {
rsync -av --files-from modifications/theemu/meemu-theme.txt modifications/theemu tainted
cp -pr untainted/app/javascript/mastodon/locales/en.json tainted/app/javascript/mastodon/locales/en.json
cp -pr untainted/config/locales/en.yml tainted/config/locales/en.yml
mv tainted/app/javascript/fonts/pressstart2p deploy/fonts/
}
build_assets_w95() {
#stylesheet deps
cp -pr modifications/w95/app/javascript/styles/cybre-base.scss tainted/app/javascript/styles/cybre-base.scss
cp -pr modifications/w95/app/javascript/styles/fullwidth-media.scss tainted/app/javascript/styles/fullwidth-media.scss
#image deps
cp -pr modifications/w95/app/javascript/images/icon_*.png deploy/images/
cp -pr modifications/w95/app/javascript/images/alert_badge.png deploy/images/alert_badge.png
cp -pr modifications/w95/app/javascript/images/start.png deploy/images/start.png
cp -pr modifications/w95/app/javascript/images/clippy_frame.png deploy/images/clippy_frame.png
cp -pr modifications/w95/app/javascript/images/clippy_wave.gif deploy/images/clippy_wave.gif
#font deps
cp -pr modifications/w95/app/javascript/fonts/premillenium deploy/fonts/
#theme
cp -pr modifications/w95/app/javascript/styles/win95.scss tainted/app/javascript/styles/win95.scss
}
build_assets_local() {
mkdir deploy/loader
cp -pr assets/loader.sh deploy/loader/loader
cp -pr assets/libloader.sh deploy/loader/
cp -pr assets/themes.yml tainted/config/themes.yml
cp -pr assets/source.rb tainted/config/initializers/source.rb
}
build_assets() {
build_assets_meemu
build_assets_w95
build_assets_local
}
build_patch() {
diff -ruN untainted tainted > deploy/queer.party.patch
}
build_image() {
docker build --build-arg MASTODON_VERSION=$DOCKER_UPSTREAM_VERSION -t maffsie/qp-mastodon:latest -t maffsie/qp-mastodon:v$TAG_VERSION deploy/
}
push_image() {
docker push maffsie/qp-mastodon
}
cleanup_prebuild() {
rm -rf untainted tainted modifications
}
cleanup_postbuild() {
rm -rf deploy/queer.party.patch deploy/fonts deploy/images deploy/loader
}
prep() {
case "$1" in
untainted) prep_untainted;;
tainted) prep_tainted;;
esac
}
build() {
case "$1" in
assets) build_assets;;
patch) build_patch;;
image) build_image;;
esac
}
push() {
case "$1" in
image) push_image;;
esac
}
cleanup() {
case "$1" in
prebuild) cleanup_prebuild;;
postbuild) cleanup_postbuild;;
esac
}
main() {
prep untainted
prep tainted
build assets
build patch
cleanup prebuild
build image
push image
cleanup postbuild
}