2025-02-12 06:06:35 -09:00
|
|
|
export mock_image := env("MOCK_IMAGE", "ghcr.io/ublue-os/ublue-builder:latest")
|
|
|
|
|
|
2024-12-12 06:15:54 -09:00
|
|
|
# Run renovate locally to test modules
|
|
|
|
|
renovate dry-run="lookup" log-level="debug":
|
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
if ! command -v "renovate" &> /dev/null ; then
|
|
|
|
|
echo "You need to install renovate first"
|
|
|
|
|
echo "It should be available on brew and on npm."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
if [ "$GITHUB_COM_TOKEN" == "" ] ; then
|
|
|
|
|
echo "Warning: No Github token found, renovate will nag at you for this."
|
|
|
|
|
echo "Set it with GITHUB_COM_TOKEN=(your token)"
|
|
|
|
|
fi
|
|
|
|
|
LOG_LEVEL=${LOG_LEVEL:-debug} renovate --platform=local --dry-run={{dry-run}}
|
|
|
|
|
echo "Updates can be found in a section of the logs called \"packageFiles with updates\""
|
|
|
|
|
|
2025-02-12 06:06:35 -09:00
|
|
|
build $spec *MOCK_ARGS:
|
2024-12-12 06:15:54 -09:00
|
|
|
#!/usr/bin/env bash
|
2025-02-12 16:50:50 -09:00
|
|
|
set -x
|
2025-02-12 06:06:35 -09:00
|
|
|
mkdir -p mock
|
|
|
|
|
# Passes your user to the container and adds it to the mock group else rpkg will not be able to recognize local changes
|
|
|
|
|
# Mock also needs to be called unprivileged apparently
|
2025-02-12 16:50:50 -09:00
|
|
|
CONTAINERS_DIR="${CONTAINERS_DIR:-/var/lib/containers}"
|
2025-02-12 17:28:48 -09:00
|
|
|
MOCK_DIR="${MOCK_DIRECTORY:-./mock}"
|
2025-02-16 16:17:50 -09:00
|
|
|
SOURCES_DIR="${SOURCES_DIR:-.}"
|
2025-02-12 06:06:35 -09:00
|
|
|
sudo podman run --privileged --rm -it \
|
2025-02-12 17:28:48 -09:00
|
|
|
-v "$CONTAINERS_DIR:/var/lib/containers:z" \
|
|
|
|
|
-v "$MOCK_DIR:/var/lib/mock:Z" \
|
2025-02-16 16:17:50 -09:00
|
|
|
-v "$SOURCES_DIR:/tmp/sources:Z" \
|
2025-02-12 06:06:35 -09:00
|
|
|
-w /tmp/sources \
|
|
|
|
|
--user "$(id -u):$(id -g)" \
|
|
|
|
|
-e PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin,HOME=/tmp \
|
|
|
|
|
--group-entry "mock:x:135:$(id -nu)" \
|
|
|
|
|
$mock_image \
|
|
|
|
|
$spec {{ MOCK_ARGS }}
|
2025-02-16 07:09:54 -09:00
|
|
|
|
|
|
|
|
generate-homebrew-tarball $OUTDIR="./brew-out" $TARBALL_FILENAME="homebrew.tar.zst":
|
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
|
|
|
|
|
mkdir -p $OUTDIR
|
|
|
|
|
|
|
|
|
|
podman run --rm -it \
|
|
|
|
|
-v "$OUTDIR:/outdir:Z" \
|
|
|
|
|
cgr.dev/chainguard/wolfi-base:latest \
|
|
|
|
|
/bin/sh -c "
|
|
|
|
|
set -o xtrace
|
2025-02-16 13:49:48 -09:00
|
|
|
apk add curl git zstd posix-libc-utils uutils gnutar grep
|
2025-02-16 07:09:54 -09:00
|
|
|
curl --retry 3 -Lo /tmp/brew-install https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh
|
|
|
|
|
chmod +x /tmp/brew-install
|
|
|
|
|
touch /.dockerenv
|
|
|
|
|
ln -s /bin/bash /usr/bin/bash
|
2025-02-16 13:49:48 -09:00
|
|
|
ls -s /usr/bin/grep /bin/grep
|
2025-02-16 07:09:54 -09:00
|
|
|
env --ignore-environment PATH=/usr/bin:/bin:/usr/sbin:/sbin HOME=/home/linuxbrew NONINTERACTIVE=1 /usr/bin/bash /tmp/brew-install
|
2025-02-16 13:49:48 -09:00
|
|
|
tar --zstd -cvf /outdir/{{ TARBALL_FILENAME }} /home/linuxbrew/.linuxbrew"
|