Update gitea-mirror.sh
This commit is contained in:
parent
4185c237ca
commit
4e195d0aca
@ -8,8 +8,8 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV
|
|||||||
APP="gitea-mirror"
|
APP="gitea-mirror"
|
||||||
var_tags="${var_tags:-arr;dashboard}"
|
var_tags="${var_tags:-arr;dashboard}"
|
||||||
var_cpu="${var_cpu:-2}"
|
var_cpu="${var_cpu:-2}"
|
||||||
var_ram="${var_ram:-4096}"
|
var_ram="${var_ram:-1024}"
|
||||||
var_disk="${var_disk:-8}"
|
var_disk="${var_disk:-5}"
|
||||||
var_os="${var_os:-debian}"
|
var_os="${var_os:-debian}"
|
||||||
var_version="${var_version:-12}"
|
var_version="${var_version:-12}"
|
||||||
var_unprivileged="${var_unprivileged:-1}"
|
var_unprivileged="${var_unprivileged:-1}"
|
||||||
@ -24,15 +24,15 @@ function update_script() {
|
|||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
if [[ ! -d /opt/homarr ]]; then
|
if [[ ! -d /opt/gite-mirror ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/homarr-labs/homarr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
RELEASE=$(curl -fsSL https://api.github.com/repos/arunavo4/gitea-mirror/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||||
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
||||||
|
|
||||||
msg_info "Stopping Services (Patience)"
|
msg_info "Stopping Services (Patience)"
|
||||||
systemctl stop homarr
|
systemctl stop gitea-mirror
|
||||||
msg_ok "Services Stopped"
|
msg_ok "Services Stopped"
|
||||||
|
|
||||||
msg_info "Backup Data"
|
msg_info "Backup Data"
|
||||||
@ -40,25 +40,21 @@ function update_script() {
|
|||||||
cp /opt/homarr/.env /opt/homarr-data-backup/.env
|
cp /opt/homarr/.env /opt/homarr-data-backup/.env
|
||||||
msg_ok "Backup Data"
|
msg_ok "Backup Data"
|
||||||
|
|
||||||
msg_info "Updating and rebuilding ${APP} to v${RELEASE} (Patience)"
|
msg_info "Installing Bun"
|
||||||
export BUN_INSTALL=/opt/bun
|
export BUN_INSTALL=/opt/bun
|
||||||
curl -fsSL https://bun.sh/install | bash
|
curl -fsSL https://bun.sh/install | bash
|
||||||
ln -sf /opt/bun/bin/bun /usr/local/bin/bun
|
ln -sf /opt/bun/bin/bun /usr/local/bin/bun
|
||||||
ln -sf /opt/bun/bin/bun /usr/local/bin/bunx
|
ln -sf /opt/bun/bin/bun /usr/local/bin/bunx
|
||||||
bun --version
|
msg_ok "Installed Bun"
|
||||||
|
|
||||||
|
msg_info "Updating and rebuilding ${APP} to v${RELEASE} (Patience)"
|
||||||
apt install -y git
|
apt install -y git
|
||||||
git clone https://github.com/arunavo4/gitea-mirror.git
|
rm -rf /opt/homarr
|
||||||
|
fetch_and_deploy_gh_release "arunavo4/gitea-mirror"
|
||||||
cd /opt/gitea-mirror
|
cd /opt/gitea-mirror
|
||||||
bun install
|
bun install
|
||||||
bun run build
|
bun run build
|
||||||
bun run manage-db init
|
bun run manage-db init
|
||||||
|
|
||||||
|
|
||||||
install_node_and_modules
|
|
||||||
rm -rf /opt/homarr
|
|
||||||
fetch_and_deploy_gh_release "homarr-labs/homarr"
|
|
||||||
|
|
||||||
else
|
else
|
||||||
msg_ok "No update required. ${APP} is already at v${RELEASE}"
|
msg_ok "No update required. ${APP} is already at v${RELEASE}"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user