Skip to content

Commit fe8b07f

Browse files
authored
Update the ubuntu bootstrap process (#4)
* Fix makemkv install for Ubuntu Make some scripts +x as well * Fix Dockerfile heredoc syntax for test script * Fix mdview installation using GitHub API instead of HTML scraping - Switch from HTML scraping to GitHub REST API (/releases/latest endpoint) - Extract amd64 .deb URL from browser_download_url JSON field - Add .deb suffix to mktemp to ensure apt recognizes file format - Eliminates unreliable regex-based HTML parsing - Both Ubuntu 24.04 and 25.10 tests now pass cleanly with mdview installed
1 parent 3a56615 commit fe8b07f

4 files changed

Lines changed: 34 additions & 29 deletions

File tree

test/docker/Dockerfile.ubuntu-noninteractive

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,18 @@ WORKDIR /home/testuser
3131
COPY --chown=testuser:testuser . /home/testuser/linux-bootstrap
3232

3333
# Create a non-interactive test runner
34-
RUN cat <<'EOF' > /home/testuser/run-tests.sh && chmod +x /home/testuser/run-tests.sh
35-
#!/bin/bash
36-
set -e
37-
cd /home/testuser/linux-bootstrap
38-
39-
# Test just the essential packages (no prompts)
40-
echo "Testing essential packages installation..."
41-
bash ubuntu/install-essential-packages
42-
43-
echo ""
44-
echo "================================="
45-
echo "Essential packages test completed"
46-
echo "================================="
47-
EOF
34+
RUN echo '#!/bin/bash' > /home/testuser/run-tests.sh && \
35+
echo 'set -e' >> /home/testuser/run-tests.sh && \
36+
echo 'cd /home/testuser/linux-bootstrap' >> /home/testuser/run-tests.sh && \
37+
echo '' >> /home/testuser/run-tests.sh && \
38+
echo '# Test just the essential packages (no prompts)' >> /home/testuser/run-tests.sh && \
39+
echo 'echo "Testing essential packages installation..."' >> /home/testuser/run-tests.sh && \
40+
echo 'bash ubuntu/install-essential-packages' >> /home/testuser/run-tests.sh && \
41+
echo '' >> /home/testuser/run-tests.sh && \
42+
echo 'echo ""' >> /home/testuser/run-tests.sh && \
43+
echo 'echo "================================="' >> /home/testuser/run-tests.sh && \
44+
echo 'echo "Essential packages test completed"' >> /home/testuser/run-tests.sh && \
45+
echo 'echo "================================="' >> /home/testuser/run-tests.sh && \
46+
chmod +x /home/testuser/run-tests.sh
4847

4948
CMD ["/home/testuser/run-tests.sh"]

ubuntu/bootstrap

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/m
2525
# Starship - https://starship.rs/
2626
curl -sS https://starship.rs/install.sh | sh
2727

28-
# Zoxide
29-
curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh
30-
3128
# Dev packages
3229
read -p "Install development tools? " -n 1 -r
3330
echo

ubuntu/install-essential-packages

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ apt-transport-https \
1414
lsb-release \
1515
wget \
1616
apt-transport-https \
17+
curl \
1718
bat \
1819
btop \
1920
detox \
@@ -35,16 +36,23 @@ tmux \
3536
ubuntu-restricted-extras \
3637
yadm \
3738
zsh \
38-
zsh-doc
39+
zsh-doc \
3940

40-
pipx install mnamer
41+
# Install zoxide/starship only on Ubuntu 25.10+, as they're not available in 24.04 repos
42+
UBUNTU_VERSION=$(lsb_release -rs 2>/dev/null || echo "24.04")
43+
if awk -v ver="$UBUNTU_VERSION" 'BEGIN {exit !(ver >= 25.10)}'; then
44+
sudo apt-get install -y zoxide starship fastfetch
45+
fi
4146

42-
# Install deb-get
43-
# https://github.com/wimpysworld/deb-get
47+
pipx install mnamer
4448

45-
curl -sL https://raw.githubusercontent.com/wimpysworld/deb-get/main/deb-get | sudo -E bash -s install deb-get
46-
sudo deb-get update
47-
sudo deb-get install \
48-
fastfetch \
49-
fd \
50-
mdview
49+
# Install latest mdview .deb from the GitHub API (amd64)
50+
MDVIEW_DEB_URL=$(curl -fsSL "https://api.github.com/repos/mapitman/mdview/releases/latest" | grep '"browser_download_url"' | grep 'amd64.*\.deb' | head -1 | cut -d'"' -f4)
51+
if [ -n "$MDVIEW_DEB_URL" ]; then
52+
MDVIEW_TMP_DEB="$(mktemp --suffix=.deb)"
53+
wget -q "$MDVIEW_DEB_URL" -O "$MDVIEW_TMP_DEB"
54+
sudo apt install -y "$MDVIEW_TMP_DEB"
55+
rm -f "$MDVIEW_TMP_DEB"
56+
else
57+
echo "mdview: unable to determine latest .deb URL" >&2
58+
fi

ubuntu/install-makemkv

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Install makemkv
55
if ! type makemkv
66
then
7-
MAKEMKV_VERSION="1.17.6"
7+
MAKEMKV_VERSION="1.18.2"
88
mkdir -p /tmp/makemkv-build
99
pushd /tmp/makemkv-build || exit
1010

@@ -29,7 +29,8 @@ then
2929
qtbase5-dev \
3030
zlib1g-dev \
3131
yasm \
32-
libfdk-aac-dev
32+
libfdk-aac-dev \
33+
nasm
3334

3435
pushd /tmp/makemkv-build/ffmpeg || exit
3536
./configure --prefix=/tmp/ffmpeg --enable-static --disable-shared --enable-pic --enable-libfdk-aac

0 commit comments

Comments
 (0)