File tree Expand file tree Collapse file tree 3 files changed +9
-17
lines changed
Expand file tree Collapse file tree 3 files changed +9
-17
lines changed Original file line number Diff line number Diff line change @@ -28,23 +28,18 @@ function update_script() {
2828 exit
2929 fi
3030 RELEASE=$( curl -fsSL https://api.github.com/repos/prometheus/prometheus/releases/latest | grep " tag_name" | awk ' {print substr($2, 3, length($2)-4) }' )
31- if [[ ! -f /opt/ ${APP} _version.txt ]] || [[ " ${RELEASE} " != " $( cat /opt/ ${APP} _version.txt ) " ]]; then
31+ if [[ ! -f ~ /.prometheus ]] || [[ " ${RELEASE} " != " $( cat ~ /.prometheus 2> /dev/null ) " ]]; then
3232 msg_info " Stopping ${APP} "
3333 systemctl stop prometheus
3434 msg_ok " Stopped ${APP} "
3535
36- msg_info " Updating ${APP} to v${RELEASE} "
37- cd /opt
38- curl -fsSL " https://github.com/prometheus/prometheus/releases/download/v${RELEASE} /prometheus-${RELEASE} .linux-amd64.tar.gz" -o $( basename " https://github.com/prometheus/prometheus/releases/download/v${RELEASE} /prometheus-${RELEASE} .linux-amd64.tar.gz" )
39- tar -xf prometheus-${RELEASE} .linux-amd64.tar.gz
40- cp -rf prometheus-${RELEASE} .linux-amd64/prometheus prometheus-${RELEASE} .linux-amd64/promtool /usr/local/bin/
41- rm -rf prometheus-${RELEASE} .linux-amd64 prometheus-${RELEASE} .linux-amd64.tar.gz
42- echo " ${RELEASE} " > /opt/${APP} _version.txt
43- msg_ok " Updated ${APP} to v${RELEASE} "
36+ fetch_and_deploy_gh_release " prometheus" " prometheus/prometheus" " prebuild" " latest" " /usr/local/bin" " *linux-amd64.tar.gz"
37+ rm -f /usr/local/bin/prometheus.yml
4438
4539 msg_info " Starting ${APP} "
4640 systemctl start prometheus
4741 msg_ok " Started ${APP} "
42+
4843 msg_ok " Updated Successfully"
4944 else
5045 msg_ok " No update required. ${APP} is already at v${RELEASE} "
Original file line number Diff line number Diff line change 99 "updateable" : true ,
1010 "privileged" : false ,
1111 "interface_port" : 9090 ,
12- "documentation" : null ,
12+ "documentation" : " https://prometheus.io/docs/introduction/overview/ " ,
1313 "website" : " https://prometheus.io/" ,
1414 "logo" : " https://cdn.jsdelivr.net/gh/selfhst/icons/webp/prometheus.webp" ,
1515 "config_path" : " /etc/prometheus/prometheus.yml" ,
Original file line number Diff line number Diff line change @@ -13,19 +13,17 @@ setting_up_container
1313network_check
1414update_os
1515
16+ fetch_and_deploy_gh_release " prometheus" " prometheus/prometheus" " prebuild" " latest" " /usr/local/bin" " *linux-amd64.tar.gz"
17+
1618msg_info " Installing Prometheus"
17- RELEASE=$( curl -fsSL https://api.github.com/repos/prometheus/prometheus/releases/latest | grep " tag_name" | awk ' {print substr($2, 3, length($2)-4) }' )
1819mkdir -p /etc/prometheus
1920mkdir -p /var/lib/prometheus
20- curl -fsSL " https://github.com/prometheus/prometheus/releases/download/v${RELEASE} /prometheus-${RELEASE} .linux-amd64.tar.gz" -o " prometheus-${RELEASE} .linux-amd64.tar.gz"
21- tar -xf prometheus-${RELEASE} .linux-amd64.tar.gz
22- mv prometheus-${RELEASE} .linux-amd64/prometheus prometheus-${RELEASE} .linux-amd64/promtool /usr/local/bin/
23- mv prometheus-${RELEASE} .linux-amd64/prometheus.yml /etc/prometheus/prometheus.yml
21+ mv /usr/local/bin/prometheus.yml /etc/prometheus/prometheus.yml
2422echo " ${RELEASE} " > /opt/${APPLICATION} _version.txt
2523msg_ok " Installed Prometheus"
2624
2725msg_info " Creating Service"
28- cat << EOF >/etc/systemd/system/prometheus.service
26+ cat << ' EOF ' >/etc/systemd/system/prometheus.service
2927[Unit]
3028Description=Prometheus
3129Wants=network-online.target
@@ -53,5 +51,4 @@ customize
5351msg_info " Cleaning up"
5452$STD apt-get -y autoremove
5553$STD apt-get -y autoclean
56- rm -rf prometheus-${RELEASE} .linux-amd64 prometheus-${RELEASE} .linux-amd64.tar.gz
5754msg_ok " Cleaned"
You can’t perform that action at this time.
0 commit comments