Our #Sharkey one-stop #upgrade script worked beautifully, and just finished using it to upgrade Sharkey here on bofh.social! #SharkeyAdmin
#!/bin/bash
set -e # Exit immediately if a command exits with a non-zero status
set -u # Treat unset variables as an error
echo "Stopping Sharkey and Redis services..."
systemctl stop sharkey
systemctl stop redis
# Optional: Update NodeJS (uncomment if needed)
# --------------------------------------------
# echo "Updating NodeJS..."
# apt remove -y nodejs
# curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
# apt install -y nodejs
# apt install -y libpango1.0-dev libcairo2-dev libpixman-1-dev
echo "Updating Sharkey codebase..."
sudo -u sharkey bash <<'EOF'
cd ~/Sharkey
git checkout stable
git stash
git pull --recurse-submodules
pnpm clean-all
# corepack enable && corepack prepare [email protected] --activate # Optional if using corepack
pnpm install --frozen-lockfile
pnpm run build
pnpm run migrate
EOF
echo "Restarting services..."
systemctl start redis
systemctl start sharkey
echo "✅ Sharkey update complete."