Git Product home page Git Product logo

Comments (3)

dswarbrick avatar dswarbrick commented on June 11, 2024

This is not the right place to report a Debian-specific bug. Please use the Debian bug tracker.

from alertmanager.

manalshaikh avatar manalshaikh commented on June 11, 2024

Okay. Thank you.

I'll just drop it here incase if anyone comes looking. I've fixed the above issue by editing generate-ui.sh in a way that it generates what it needs to generate, then takes script.js into account and then gets rid of everything. It then downloads the files from repo and uses script.js to do the job. A cheesy way but it can be improved further if anyone wants it:

#!/bin/bash

set -euo pipefail

ELMDISTURL=https://github.com/elm/compiler/releases/download/0.19.1/binary-for-linux-64-bit.gz
DATEPICKER_CSS_URL=https://raw.githubusercontent.com/elm-community/elm-datepicker/master/css/elm-datepicker.css
BOOTSTRAP_URL=https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css
SRCDIR=/usr/share/gocode/src/github.com/prometheus/alertmanager/ui/app
DSTDIR=/usr/share/prometheus/alertmanager/ui

echo "Installing dependencies..." >&2
apt update
apt install -yy curl uglifyjs git \
    golang-github-prometheus-alertmanager-dev

#/usr/share/fonts-font-awesome/
TMPDIR=$(mktemp -d)


echo "Downloading Elm tools..." >&2
curl --location $ELMDISTURL | gunzip -c - > $TMPDIR/elm
chmod +x $TMPDIR/elm

echo "Compiling source code..." >&2
ln -s $SRCDIR/src $SRCDIR/elm.json $TMPDIR
(cd $TMPDIR; ./elm make src/Main.elm --optimize --output $TMPDIR/app.js)

echo "Optimising source code..." >&2
uglifyjs $TMPDIR/app.js \
    --compress 'pure_funcs="F2,F3,F4,F5,F6,F7,F8,F9,A2,A3,A4,A5,A6,A7,A8,A9",pure_getters,keep_fargs=false,unsafe_comps,unsafe' \
    --mangle --output $TMPDIR/script.js

echo "Installing in Alertmanager directory..." >&2
mkdir -p $DSTDIR
cp $TMPDIR/script.js $DSTDIR
cp $SRCDIR/index.html $SRCDIR/favicon.ico $DSTDIR

rm -rf $TMPDIR

# Step 1: Clone the repository
echo "Cloning Alertmanager repository..."
git clone https://github.com/prometheus/alertmanager /tmp/alertmanager_repo
sleep 1

# Step 2: Backup script.js, delete other files inside /usr/share/prometheus/alertmanager/ui/
echo "Backing up script.js and deleting other files inside /usr/share/prometheus/alertmanager/ui/..."
mv /usr/share/prometheus/alertmanager/ui/script.js /tmp
rm -rf /usr/share/prometheus/alertmanager/ui/*
sleep 1

# Step 3: Move content of cloned repository to /usr/share/prometheus/alertmanager/ui/
echo "Moving contents of cloned repository to /usr/share/prometheus/alertmanager/ui/..."
mv /tmp/alertmanager_repo/ui/app/* /usr/share/prometheus/alertmanager/ui/
sleep 1

# Step 4: Move script.js back to /usr/share/prometheus/alertmanager/ui/
echo "Moving script.js back to /usr/share/prometheus/alertmanager/ui/..."
mv /tmp/script.js /usr/share/prometheus/alertmanager/ui/
sleep 1

# Step 5: Rename bootstrap-4.0.0-alpha.6-dist to bootstrap
echo "Renaming bootstrap-4.0.0-alpha.6-dist to bootstrap..."
mv /usr/share/prometheus/alertmanager/ui/lib/bootstrap-4.0.0-alpha.6-dist /usr/share/prometheus/alertmanager/ui/lib/bootstrap
sleep 1

# Step 6: Rename font-awesome-4.7.0 to font-awesome
echo "Renaming font-awesome-4.7.0 to font-awesome..."
mv /usr/share/prometheus/alertmanager/ui/lib/font-awesome-4.7.0 /usr/share/prometheus/alertmanager/ui/lib/font-awesome
sleep 1

echo "Deleting repo as its no longer needed"
rm -rf /tmp/alertmanager_repo

echo "Alertmanager restart required. Other than that, if you haven't seen any error above, the installation is completed!"

echo "Alertmanager updated successfully!"

from alertmanager.

dswarbrick avatar dswarbrick commented on June 11, 2024

You probably also would have stumbled across https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1067469, if you had checked the Debian bug tracker.

from alertmanager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.