runner-images/build.sh

17 lines
421 B
Bash
Raw Normal View History

2023-08-07 08:38:16 +00:00
#!/bin/sh
2023-08-07 08:49:37 +00:00
IMAGE_NAME=$(echo $GITHUB_SERVER_URL/$GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]' | cut -d '/' -f3-)
2023-08-07 09:04:54 +00:00
for d in ./images/*
do
for i in $d/*
do
echo "Building $i"
DISTRO=$(echo $i | cut -d '/' -f 3)
2023-08-07 09:09:54 +00:00
VERSION=$(echo $i | cut -d '/' -f 4 | cut -d '.' -f2-)
2023-08-07 09:04:54 +00:00
2023-08-07 09:09:54 +00:00
docker build -f $i . -t $IMAGE_NAME:$DISTRO$VERSION
docker push $IMAGE_NAME:$DISTRO$VERSION
2023-08-07 09:04:54 +00:00
done
done