test: initialize local apt repository for testing
This with the combination of `podman run --rm -v "$PWD:/tmp/shione" -it debian:stable /bin/bash` allows me to quickly install packages to validate that the installation process is valid. Post-deployment failures/mis-configurations are another problem.
This commit is contained in:
parent
cd8f0e853f
commit
8a556f59d3
1 changed files with 37 additions and 0 deletions
37
init.sh
Executable file
37
init.sh
Executable file
|
@ -0,0 +1,37 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -eux
|
||||
|
||||
apt update
|
||||
apt install -y apt-utils
|
||||
|
||||
mkdir -p -- /var/shione/debian/pool/main
|
||||
cp -- /tmp/shione/build/*.deb /var/shione/debian/pool/main
|
||||
|
||||
# XXX: Stolen from `local-apt-repository` which did not work for me for some reason.
|
||||
debs_dir_path=/var/shione/debian
|
||||
deb_repo_path=/var/lib/local-apt-repository
|
||||
mkdir -p -- "$deb_repo_path"
|
||||
|
||||
# Relative paths work better than absolute
|
||||
cd -- "$deb_repo_path"
|
||||
apt-ftparchive packages ../../../"$debs_dir_path" >"$deb_repo_path"/Packages
|
||||
apt-ftparchive sources ../../../"$debs_dir_path" >"$deb_repo_path"/Sources
|
||||
|
||||
apt-ftparchive \
|
||||
-o "APT::FTPArchive::Release::Origin=local-apt-repository-shione" \
|
||||
-o "APT::FTPArchive::Release::Description=Local repository created by a minimal version of local-apt-repository" \
|
||||
release "$deb_repo_path" > "$deb_repo_path"/Release
|
||||
|
||||
<<-EOF cat -- >/etc/apt/sources.list.d/local-apt-repository.list
|
||||
# This enables the local repositories provided by local-apt-repository
|
||||
#
|
||||
# We do not use cryptographic signatures, as they are read from local system
|
||||
# anyways.
|
||||
deb [trusted=yes] file:///var/lib/local-apt-repository/ ./
|
||||
deb-src [trusted=yes] file:///var/lib/local-apt-repository/ ./
|
||||
EOF
|
||||
|
||||
apt update
|
||||
|
||||
apt install -y nftables-config
|
Loading…
Reference in a new issue