Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto Update #5117

Open
cpjet64 opened this issue Sep 19, 2024 · 0 comments
Open

Auto Update #5117

cpjet64 opened this issue Sep 19, 2024 · 0 comments
Labels
feature-request Request for new features to be added

Comments

@cpjet64
Copy link

cpjet64 commented Sep 19, 2024

📑 I have found these related issues/pull requests

Love this app and wanted to send in my autoupdating baremetal stuff that runs once per day. i have it deployed in a lxc container on proxmox using debian 12 image. Please feel free to add it to the baremetal instructions if you'd like.

🏷️ Feature Request Type

Deployment

🔖 Feature description

There are plenty of valid reasons for not using autoupdate but for home use it works great.

✔️ Solution

create the script

# nano /opt/uptime-kuma/update.sh

script contents

#!/bin/bash

# Navigate to Uptime Kuma directory
cd /opt/uptime-kuma

# Fetch the latest code from the repository
git fetch --all

# Get the latest stable release tag
latest_tag=$(git tag --sort=-creatordate | head -n 1)
echo "Checking out the latest tag: $latest_tag"

# Check out the latest stable release
git checkout $latest_tag --force

# Install dependencies and download prebuilt files
npm install --production
npm run download-dist

# Restart Uptime Kuma using PM2
pm2 restart uptime-kuma

make the script executable

# chmod +x /opt/uptime-kuma/update.sh

set a cron job to execute the script once per day (currently runs at 2AM)

# (crontab -l; echo "0 2 * * * /opt/uptime-kuma/update.sh >> /opt/uptime-kuma/update.log 2>&1") | sed '/^$/d' | crontab -

❓ Alternatives

No response

📝 Additional Context

No response

@cpjet64 cpjet64 added the feature-request Request for new features to be added label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features to be added
Projects
None yet
Development

No branches or pull requests

1 participant