From 5726d2b76f92487fedde76990b9f918792fc895a Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sun, 22 Dec 2024 20:29:33 -0600 Subject: [PATCH] ci: Use persistent volumes for portage, binpkgs Recompiling the entire OS for every build takes way too long for development purposes. Since we build binary packages anyway, let's keep them around between builds by storing them on a Kubernetes persistent volume. Eventually, I want add a build parameter to wipe out the binary package storage to force a from-scratch build. We'll use that option for robust periodic builds, once development has slowed down. --- ci/podTemplate.yaml | 17 +++++++++++++---- prepare.sh | 8 ++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 prepare.sh diff --git a/ci/podTemplate.yaml b/ci/podTemplate.yaml index 7ea65cf..f4bc25b 100644 --- a/ci/podTemplate.yaml +++ b/ci/podTemplate.yaml @@ -21,12 +21,21 @@ spec: name: workspace-volume subPath: gentoo - mountPath: /usr/aarch64-unknown-linux-gnu/var/cache/binpkgs - name: workspace-volume - subPath: binpkgs + name: binpkgs + subPath: photoframe2 - mountPath: /var/cache/binpkgs - name: workspace-volume - subPath: binpkgs + name: binpkgs + subPath: photoframe2 - mountPath: /var/cache/distfiles name: workspace-volume subPath: distfiles + - mountPath: /var/db/repos/gentoo + name: portage hostUsers: false + volumes: + - name: binpkgs + persistentVolumeClaim: + claimName: binpkgs + - name: portage + persistentVolumeClaim: + claimName: portage diff --git a/prepare.sh b/prepare.sh new file mode 100644 index 0000000..aa4d100 --- /dev/null +++ b/prepare.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ ! -f /var/db/repos/gentoo/metadata/timestamp ]; then + emerge-webrsync +fi +if [ "$(find /var/db/repos/gentoo/metadata -newermt '-24 hours' | wc -l)" -eq 0 ]; then + emaint sync +fi