automate snapshot date bump

This commit is contained in:
Lance Vick 2020-07-23 04:12:31 -07:00
parent f806367aa6
commit ba24e9f786
Signed by: lrvick
GPG Key ID: 8E47A1EC35A1551D
2 changed files with 12 additions and 1 deletions

View File

@ -119,11 +119,15 @@ update-packages:
--user $(userid):$(groupid) \
--volume $(PWD)/config:/home/build/config \
--volume $(PWD)/scripts:/home/build/scripts \
--env GIT_EPOCH="$(GIT_EPOCH)" \
$(IMAGE) tail -f /dev/null
$(docker) exec -it --user=root "$(NAME)" update-packages
$(docker) cp \
"$(NAME):/etc/apt/packages.list" \
"$(PWD)/config/container/packages.list"
$(docker) cp \
"$(NAME):/etc/apt/sources.list" \
"$(PWD)/config/container/sources.list"
$(docker) rm -f "$(NAME)"
## Make Helpers

View File

@ -1,8 +1,15 @@
#!/bin/bash
[ -f /.dockerenv ] || { echo "please run in supplied container"; exit 1; }
set -e
apt update -y
apt upgrade -y
dpkg -l | awk '{ if ($1 == "ii") print $2 "=" $3 }' > /etc/apt/packages.list
snapshot_date=$(date -d @${GIT_EPOCH} +"%Y%m%dT000000Z")
cat <<-EOF > /etc/apt/sources.list
deb http://snapshot.debian.org/archive/debian/${snapshot_date} buster main
deb http://snapshot.debian.org/archive/debian-security/${snapshot_date} buster/updates main
deb http://snapshot.debian.org/archive/debian/${snapshot_date} buster-updates main
EOF