mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-09-13 07:10:51 +02:00
GoMFT: Add frontend build procedure (#3499)
This commit is contained in:
15
ct/gomft.sh
15
ct/gomft.sh
@@ -32,7 +32,13 @@ function update_script() {
|
||||
if ! dpkg -l | grep -q "^ii.*build-essential"; then
|
||||
$STD apt-get install -y build-essential
|
||||
fi
|
||||
|
||||
if [[ ! -f "/usr/bin/node" ]]; then
|
||||
mkdir -p /etc/apt/keyrings
|
||||
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
|
||||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
|
||||
$STD apt-get update
|
||||
$STD apt-get install -y nodejs
|
||||
fi
|
||||
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
||||
msg_info "Stopping $APP"
|
||||
systemctl stop gomft
|
||||
@@ -45,8 +51,11 @@ function update_script() {
|
||||
tar -xzf $temp_file
|
||||
cp -rf GoMFT-v.${RELEASE}/* /opt/gomft
|
||||
cd /opt/gomft
|
||||
rm -f /opt/gomft/node_modules
|
||||
$STD npm ci
|
||||
$STD node build.js
|
||||
$STD go mod download
|
||||
$STD go install github.com/a-h/templ/cmd/templ@latest
|
||||
$STD go get -u github.com/a-h/templ
|
||||
$STD $HOME/go/bin/templ generate
|
||||
export CGO_ENABLED=1
|
||||
export GOOS=linux
|
||||
@@ -57,7 +66,7 @@ function update_script() {
|
||||
|
||||
msg_info "Cleaning Up"
|
||||
rm -f $temp_file
|
||||
rm -rf GoMFT-${RELEASE}
|
||||
rm -rf $HOME/GoMFT-v.${RELEASE}
|
||||
msg_ok "Cleanup Complete"
|
||||
|
||||
msg_info "Starting $APP"
|
||||
|
||||
Reference in New Issue
Block a user