proot-apps/ci-scripts/update-packages.sh
2024-04-13 14:11:46 -07:00

20 lines
553 B
Bash

#! /bin/bash
set -e
IMAGE=$1
cd apps/$IMAGE
docker build --build-arg REPO=${GITHUB_REPOSITORY} -t $IMAGE:latest .
docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v $(pwd):/tmp \
ghcr.io/anchore/syft:latest \
$IMAGE:latest -o table=/tmp/package_versions_check.txt
if [ ! -f 'package_versions.txt' ]; then
mv package_versions_check.txt package_versions.txt
elif ! diff -q package_versions_check.txt package_versions.txt; then
mv package_versions_check.txt package_versions.txt
else
rm -f package_versions_check.txt
fi