mmdl: fix release parsing in mmdl.sh
This commit is contained in:
parent
b5dd69a7c0
commit
bac998fc10
@ -29,7 +29,7 @@ function update_script() {
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RELEASE=$(curl -s https://api.github.com/repos/intri-in/manage-my-damn-life-nextjs/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
RELEASE=$(curl -s https://api.github.com/repos/intri-in/manage-my-damn-life-nextjs/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||||
if [[ "${RELEASE}" != "$(cat /opt/mmdl_version.txt)" ]] || [[ ! -f /opt/mmdl_version.txt ]]; then
|
if [[ "${RELEASE}" != "$(cat /opt/mmdl_version.txt)" ]] || [[ ! -f /opt/mmdl_version.txt ]]; then
|
||||||
msg_info "Stopping $APP"
|
msg_info "Stopping $APP"
|
||||||
systemctl stop mmdl
|
systemctl stop mmdl
|
||||||
|
@ -34,7 +34,7 @@ $STD mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH
|
|||||||
} >>~/mmdl.creds
|
} >>~/mmdl.creds
|
||||||
msg_ok "Set up Database"
|
msg_ok "Set up Database"
|
||||||
|
|
||||||
msg_info "Setup ${APPLICATION}"
|
msg_info "Installing ${APPLICATION}"
|
||||||
RELEASE=$(curl -s https://api.github.com/repos/intri-in/manage-my-damn-life-nextjs/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
RELEASE=$(curl -s https://api.github.com/repos/intri-in/manage-my-damn-life-nextjs/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||||
curl -fsSLO "https://github.com/intri-in/manage-my-damn-life-nextjs/archive/refs/tags/v${RELEASE}.zip"
|
curl -fsSLO "https://github.com/intri-in/manage-my-damn-life-nextjs/archive/refs/tags/v${RELEASE}.zip"
|
||||||
unzip -q v"$RELEASE".zip
|
unzip -q v"$RELEASE".zip
|
||||||
@ -57,7 +57,7 @@ $STD npm install
|
|||||||
$STD npm run migrate
|
$STD npm run migrate
|
||||||
$STD npm run build
|
$STD npm run build
|
||||||
echo "${RELEASE}" >/opt/mmdl_version.txt
|
echo "${RELEASE}" >/opt/mmdl_version.txt
|
||||||
msg_ok "Setup ${APPLICATION}"
|
msg_ok "Installed ${APPLICATION}"
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
cat <<EOF >/etc/systemd/system/mmdl.service
|
cat <<EOF >/etc/systemd/system/mmdl.service
|
||||||
|
Loading…
x
Reference in New Issue
Block a user