Skip to content

Instantly share code, notes, and snippets.

@glacials
Last active July 17, 2023 19:53
Show Gist options
  • Save glacials/491ec4d812fee80e9f28ed66f003ad7a to your computer and use it in GitHub Desktop.
Save glacials/491ec4d812fee80e9f28ed66f003ad7a to your computer and use it in GitHub Desktop.
Update Lemmy (Debian, no Docker)
#!/bin/bash
set -euxo pipefail
cd /var/lib/lemmy-ui
uiversion=$(git tag | grep -v "rc
beta
v
0.9." | tail --lines 1)
echo "Updating lemmy-ui to $uiversion; check https://github.com/lemmynet/lemmy-ui/tags to confirm"
sudo -u lemmy -H sh -c "git checkout main"
sudo -u lemmy -H sh -c "git pull --tags"
sudo -u lemmy -H sh -c "git checkout $uiversion"
sudo -u lemmy -H sh -c "git submodule update"
sudo -u lemmy -H sh -c "yarn install --pure-lockfile"
sudo -u lemmy -H sh -c "yarn build:prod"
sudo systemctl restart lemmy-ui
cargo install lemmy_server --target-dir /usr/bin/ --locked --features embed-pictrs
sudo systemctl restart lemmy
cd /var/lib/pictrs-source
rustup update
git checkout main
git pull --tags
# officially, we're supposed to check docker-compose.yml for pict-rs version used by lemmy:
# https://github.com/LemmyNet/lemmy-ansible/blob/main/templates/docker-compose.yml
git checkout $(git describe --tags)
# or simply add the bin folder to your $PATH
$HOME/.cargo/bin/cargo build --release
sudo systemctl stop pictrs
sudo cp target/release/pict-rs /usr/bin/
sudo systemctl start pictrs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment