Browse Source

loader should be done now, added maintenance functions, TODO add upgrade tasks and arbitrary task definition

master
root 7 months ago
parent
commit
41db1fdc38
4 changed files with 31 additions and 5 deletions
  1. 31
      assets/libloader.sh
  2. 1
      assets/loader.sh
  3. 2
      deploy/Dockerfile
  4. 2
      libqueerpatchy.sh

31
assets/libloader.sh

@ -19,8 +19,8 @@ CMD_STR="yarn start"
CMD_SDK="bundle exec sidekiq"
#Commands - Upgrades and Maintenance
CMD_MAINT_CARDS="bin/tootctl preview_cards remove --days=$TUN_MAINT_CARDS_LIFETIME"
CMD_MAINT_MEDIA="bin/tootctl media remove --days=$TUN_MAINT_MEDIA_LIFETIME"
CMD_MAINT_CARDS="bin/tootctl preview_cards remove"
CMD_MAINT_MEDIA="bin/tootctl media remove"
CMD_UPG_DB_PRE="SKIP_POST_DEPLOYMENT_MIGRATIONS=true rails db:migrate"
CMD_UPG_DB_ALL="rails db:migrate"
CMD_UPG_SG_SCH="bin/tootctl upgrade storage-schema"
@ -142,4 +142,29 @@ role_sk() {
;;
esac
}
role_maint_cards() {
enrich mastodon
enrich db
enrich sg
CMD_RUN="$CMD_MAINT_CARDS --days=$TUN_MAINT_CARDS_LIFETIME"
}
role_maint_media() {
enrich mastodon
enrich db
enrich sg
CMD_RUN="$CMD_MAINT_MEDIA --days=$TUN_MAINT_MEDIA_LIFETIME"
}
role_maint() {
if [ "x$MTASK" = "x" ]; then
_err Maintenance task not defined.
exit 1
fi
case "$MTASK" in
cards) role_maint_cards;;
media) role_maint_media;;
*)
_err Maintenance task not recognised.
exit 1
;;
esac
}

1
assets/loader.sh

@ -21,6 +21,7 @@ case "$ROLE" in
web) role_web;;
stream) role_stream;;
sidekiq) role_sk;;
maintenance) role_maint;;
*)
_err Defined role is not understood.
exit 1

2
deploy/Dockerfile

@ -30,4 +30,4 @@ RUN apt-get remove -y patch git && \
rm -rf /var/cache/apt/archives /var/lib/apt/lists /patches
COPY loader/* /ldr/
USER mastodon
CMD ["/ldr/loader.sh"]
CMD ["/ldr/loader"]

2
libqueerpatchy.sh

@ -46,7 +46,7 @@ build_assets_w95() {
}
build_assets_local() {
mkdir deploy/loader
cp -pr assets/loader.sh 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

Loading…
Cancel
Save