Fix order of execution

Added node version to setup_nodejs
Added location of app file in fetch and deploy
This commit is contained in:
DragoQC 2025-11-29 09:06:18 -05:00
parent 4db61c4de6
commit 0ec3a00524
2 changed files with 8 additions and 14 deletions

View File

@ -47,16 +47,13 @@ function update_script() {
rm -rf /opt/discopanel rm -rf /opt/discopanel
CLEAN_INSTALL= 1 fetch_and_deploy_gh_release "discopanel" "nickheyer/discopanel" "tarball" "latest" "/opt/discopanel" CLEAN_INSTALL= 1 fetch_and_deploy_gh_release "discopanel" "nickheyer/discopanel" "tarball" "latest" "/opt/discopanel"
msg_info "Building frontend" msg_info "Setting up DiscoPanel"
cd /opt/discopanel/web/discopanel cd /opt/discopanel/web/discopanel
$STD npm install $STD npm install
$STD npm run build $STD npm run build
msg_ok "Builded frontend"
msg_info "Building backend"
cd /opt/discopanel cd /opt/discopanel
$STD go build -o discopanel cmd/discopanel/main.go $STD go build -o discopanel cmd/discopanel/main.go
msg_ok "Builded backend" msg_ok "Setup DiscoPanel"
msg_info "Restoring Data" msg_info "Restoring Data"
cp -r /opt/discopanel_backup_last/* /opt/discopanel/data/ cp -r /opt/discopanel_backup_last/* /opt/discopanel/data/

View File

@ -17,6 +17,10 @@ msg_info "Installing Dependencies"
$STD apt install -y build-essential $STD apt install -y build-essential
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
NODE_VERSION="22" setup_nodejs
setup_go
fetch_and_deploy_gh_release "discopanel" "nickheyer/discopanel" "tarball" "latest" "/opt/discopanel"
msg_info "Installing Docker" msg_info "Installing Docker"
DOCKER_CONFIG_PATH='/etc/docker/daemon.json' DOCKER_CONFIG_PATH='/etc/docker/daemon.json'
mkdir -p $(dirname $DOCKER_CONFIG_PATH) mkdir -p $(dirname $DOCKER_CONFIG_PATH)
@ -24,20 +28,13 @@ echo -e '{\n "log-driver": "journald"\n}' >/etc/docker/daemon.json
$STD sh <(curl -fsSL https://get.docker.com) $STD sh <(curl -fsSL https://get.docker.com)
msg_ok "Installed Docker" msg_ok "Installed Docker"
fetch_and_deploy_gh_release "discopanel" "nickheyer/discopanel" "tarball" msg_info "Setting up DiscoPanel"
setup_nodejs
setup_go
msg_info "Building DiscoPanel frontend"
cd /opt/discopanel/web/discopanel cd /opt/discopanel/web/discopanel
$STD npm install $STD npm install
$STD npm run build $STD npm run build
msg_ok "Built DiscoPanel frontend"
msg_info "Building DiscoPanel backend"
cd /opt/discopanel cd /opt/discopanel
$STD go build -o discopanel cmd/discopanel/main.go $STD go build -o discopanel cmd/discopanel/main.go
msg_ok "Built DiscoPanel backend" msg_ok "Setup DiscoPanel"
msg_info "Creating Service" msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/discopanel.service cat <<EOF >/etc/systemd/system/discopanel.service