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.
 
 
 
 

70 lines
1.9 KiB

  1. #!/bin/sh
  2. if [ "x$1" != "x" ]; then MASTODON_VERSION=$1; fi
  3. if [ "x$MASTODON_VERSION" == "x" ]; then
  4. echo "Please specify a version as the first argument or via env. var. MASTODON_VERSION">/dev/stderr
  5. exit 1
  6. fi
  7. prep_untainted() {
  8. git clone https://git.maff.scot/mirrors/mastodon untainted
  9. cd untainted
  10. git fetch --all --tags
  11. git checkout tags/v$MASTODON_VERSION
  12. cd ..
  13. }
  14. prep_tainted() {
  15. cp -pr untainted tainted
  16. mkdir modifications
  17. git clone https://github.com/meemudotorg/theemu modifications/theemu
  18. }
  19. build_assets() {
  20. rsync -av --files-from modifications/theemu/meemu-theme.txt modifications/theemu tainted
  21. cp -pr untainted/app/javascript/mastodon/locales/en.json tainted/app/javascript/mastodon/locales/en.json
  22. cp -pr untainted/config/locales/en.yml tainted/config/locales/en.yml
  23. cp -pr assets/themes.yml tainted/config/themes.yml
  24. cp -pr assets/source.rb tainted/config/initializers/source.rb
  25. mv tainted/app/javascript/fonts/pressstart2p deploy/
  26. }
  27. build_patch() {
  28. diff -ruN untainted tainted > deploy/queer.party.patch
  29. }
  30. cleanup_prebuild() {
  31. rm -rf untainted tainted modifications
  32. }
  33. build_image() {
  34. docker build --build-arg MASTODON_VERSION=$MASTODON_VERSION -t maffsie/qp-mastodon:latest -t maffsie/qp-mastodon:v$MASTODON_VERSION deploy/
  35. if [ "x$NOPUSH" == "x" -a -f ~/.docker/config.json ]; then docker push maffsie/qp-mastodon:v$MASTODON_VERSION;docker push maffsie/qp-mastodon:latest; fi
  36. }
  37. cleanup_postbuild() {
  38. rm -rf deploy/queer.party.patch deploy/pressstart2p
  39. }
  40. prep() {
  41. case "$1" in
  42. untainted) prep_untainted;;
  43. tainted) prep_tainted;;
  44. esac
  45. }
  46. build() {
  47. case "$1" in
  48. assets) build_assets;;
  49. patch) build_patch;;
  50. image) build_image;;
  51. esac
  52. }
  53. cleanup() {
  54. case "$1" in
  55. prebuild) cleanup_prebuild;;
  56. postbuild) cleanup_postbuild;;
  57. esac
  58. }
  59. main() {
  60. prep untainted
  61. prep tainted
  62. build assets
  63. build patch
  64. cleanup prebuild
  65. build image
  66. cleanup postbuild
  67. }