-
-
Notifications
You must be signed in to change notification settings - Fork 762
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
[Breaking] Update Zigbee2mqtt to v.2.0.0 (Read PR Description) #1221
Changes from 5 commits
56febab
79a2ff3
8f5fe06
57fc6c3
c5ab055
c69bfd1
d883b6d
7465e20
67403c5
420a0a6
4bd2ea4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,15 +14,16 @@ network_check | |
update_os | ||
|
||
msg_info "Installing Dependencies" | ||
$STD apt-get install -y curl | ||
$STD apt-get install -y sudo | ||
$STD apt-get install -y mc | ||
$STD apt-get install -y git | ||
$STD apt-get install -y make | ||
$STD apt-get install -y g++ | ||
$STD apt-get install -y gcc | ||
$STD apt-get install -y ca-certificates | ||
$STD apt-get install -y gnupg | ||
$STD apt-get install -y \ | ||
curl \ | ||
sudo \ | ||
mc \ | ||
git \ | ||
make \ | ||
g++ \ | ||
gcc \ | ||
ca-certificates \ | ||
gnupg | ||
msg_ok "Installed Dependencies" | ||
|
||
msg_info "Setting up Node.js Repository" | ||
|
@@ -36,37 +37,46 @@ $STD apt-get update | |
$STD apt-get install -y nodejs | ||
MickLesk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
msg_ok "Installed Node.js" | ||
|
||
msg_info "Setting up Zigbee2MQTT Repository" | ||
$STD git clone --depth 1 https://github.com/Koenkk/zigbee2mqtt.git /opt/zigbee2mqtt | ||
msg_ok "Set up Zigbee2MQTT Repository" | ||
msg_info "Installing pnpm" | ||
$STD npm install -g pnpm | ||
msg_ok "Installed pnpm" | ||
|
||
msg_info "Installing Zigbee2MQTT" | ||
msg_info "Setting up Zigbee2MQTT" | ||
cd /opt | ||
$STD corepack enable | ||
RELEASE=$(curl -s https://api.github.com/repos/Koenkk/zigbee2mqtt/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') | ||
wget -q "https://github.com/Koenkk/zigbee2mqtt/archive/refs/tags/${RELEASE}.zip" | ||
unzip -q ${RELEASE}.zip | ||
mv zigbee2mqtt-${RELEASE} /opt/zigbee2mqtt | ||
cd /opt/zigbee2mqtt/data | ||
mv configuration.example.yaml configuration.yaml | ||
cd /opt/zigbee2mqtt | ||
$STD npm ci | ||
$STD pnpm install | ||
MickLesk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
msg_ok "Installed Zigbee2MQTT" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't there be a buildstep somewhere with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For what? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's what the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But the Script do an Git Pull, i hate Git pulls, because its breaking often some scripts There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair point, I didn't realize you changed install to stable version from release assets. I like this approach much better. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Exactly. Zigbee2MQTT is written in typescript. The start command only runs the index.js file and without the build command there is no There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. actually I think you should run There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's exactly the idea. |
||
|
||
msg_info "Creating Service" | ||
service_path="/etc/systemd/system/zigbee2mqtt.service" | ||
cat <<EOF >/etc/systemd/system/zigbee2mqtt.service | ||
echo "[Unit] | ||
Description=zigbee2mqtt | ||
After=network.target | ||
[Service] | ||
Environment=NODE_ENV=production | ||
ExecStart=/usr/bin/npm start | ||
ExecStart=/usr/bin/pnpm start | ||
WorkingDirectory=/opt/zigbee2mqtt | ||
StandardOutput=inherit | ||
StandardError=inherit | ||
Restart=always | ||
User=root | ||
[Install] | ||
WantedBy=multi-user.target" >$service_path | ||
$STD systemctl enable zigbee2mqtt.service | ||
EOF | ||
systemctl enable -q --now zigbee2mqtt.service | ||
msg_ok "Created Service" | ||
|
||
motd_ssh | ||
customize | ||
|
||
msg_info "Cleaning up" | ||
rm -rf /opt/${RELEASE}.zip | ||
$STD apt-get -y autoremove | ||
$STD apt-get -y autoclean | ||
msg_ok "Cleaned" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the Debian
npm
package containspnpm
, does it?If not, this is what the pnpm website suggest for installing on POSIX systems:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the install script uses
npm install -g pnpm
, so maybe we should keep it consistent here. Withnodejs
being installed,npm
will be present.