fixes to imagen

This commit is contained in:
Madison Grubb
2026-03-13 11:17:38 -04:00
parent 2456195fbc
commit 7df63f21aa
7 changed files with 38 additions and 103 deletions
-9
View File
@@ -1,9 +0,0 @@
* text=auto eol=lf
# scripts
*.sh text eol=lf
*.bat text eol=crlf
## DOCKER
*.dockerignore text
Dockerfile text
+14 -26
View File
@@ -42,45 +42,33 @@ jobs:
uses: https://git.keligrubb.com/actions/docker-login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: jasper-agent
password: ${{ secrets.JASPER_REPO_TOKEN }}
username: actions-runner
password: ${{ secrets.ACTIONS_REPO_TOKEN }}
- name: Set up Docker Buildx
uses: https://git.keligrubb.com/actions/docker-setup-buildx-action@v4
- name: Compute tags and metadata
run: |
if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
PART_TAG=$(date +%Y%m%d)
else
PART_TAG=dev
fi
echo "PART_TAG=$PART_TAG" >> "$GITHUB_ENV"
if [ "${LATEST_TAG}" = "${{ matrix.TAG }}" ]; then
RELEASE_TAG=$(lsb_release -rs)
else
RELEASE_TAG="${{ matrix.TAG }}"
fi
echo "RELEASE_TAG=$RELEASE_TAG" >> "$GITHUB_ENV"
BUILD_DATE=$(date -u +"%Y-%m-%d %H:%M:%SZ")
echo "BUILD_DATE=$BUILD_DATE" >> "$GITHUB_ENV"
TAG_NAME="act-${{ matrix.TAG }}"
RELEASE_TAG="${{ matrix.TAG }}"
BUILD_DATE=$(date -u +"%Y-%m-%d %H:%M:%SZ")
{
echo "PART_TAG=$PART_TAG"
echo "RELEASE_TAG=$RELEASE_TAG"
echo "BUILD_DATE=$BUILD_DATE"
echo "ACT_TEST_IMAGE=${{ env.REGISTRY }}/${{ env.SLUG }}:${TAG_NAME}-${PART_TAG}"
} >>"$GITHUB_ENV"
{
echo "${TAG_NAME}-${PART_TAG}"
if [ "${LATEST_TAG}" = "${{ matrix.TAG }}" ]; then
echo "act-latest-${PART_TAG}"
fi
[ "${LATEST_TAG}" = "${{ matrix.TAG }}" ] && echo "act-latest-${PART_TAG}"
echo "${TAG_NAME}"
if [ "${LATEST_TAG}" = "${{ matrix.TAG }}" ]; then
echo "act-latest"
fi
[ "${LATEST_TAG}" = "${{ matrix.TAG }}" ] && echo "act-latest"
} > .tags
echo "ACT_TEST_IMAGE=${{ env.REGISTRY }}/${{ env.SLUG }}:${TAG_NAME}-${PART_TAG}" >> "$GITHUB_ENV"
- name: Build Docker image
uses: https://git.keligrubb.com/actions/docker-build-push-action@v7
with:
-2
View File
@@ -9,14 +9,12 @@ ARG TARGETARCH
ARG FROM_IMAGE
ARG FROM_TAG
# > Our custom ARGs
# latest Node.js LTS versions
ARG NODE_VERSION="20 24"
ARG DISTRO=ubuntu
ARG TYPE=act
ARG RUNNER
# > Force apt to not be interactive/not ask
ENV DEBIAN_FRONTEND=noninteractive
SHELL [ "/bin/bash", "--login", "-e", "-o", "pipefail", "-c" ]
+2 -11
View File
@@ -9,12 +9,7 @@ Built from [`scripts/act.sh`](./scripts/act.sh). Published to this repos Gite
- **Registry:** `git.keligrubb.com`
- **Image:** `git.keligrubb.com/actions/ubuntu`
- **Tags:** `act-22.04`, `act-24.04`, `act-latest` (and dated tags e.g. `act-24.04-YYYYMMDD`)
## When images are updated
- Dependencies required for actions change
- Changes to GitHub Actions, Act, or the container registry
- Size or performance improvements
- **Base image:** `buildpack-deps` ([overview](https://hub.docker.com/_/buildpack-deps), [tags](https://hub.docker.com/_/buildpack-deps/tags), [source](https://github.com/docker-library/buildpack-deps))
## Build locally
@@ -76,11 +71,7 @@ act -P ubuntu-latest=git.keligrubb.com/actions/ubuntu:act-24.04
Or put the image in `.actrc` or your workflows `runs-on` image.
## Customising
Edit [`scripts/act.sh`](./scripts/act.sh) to add or remove packages. Keep `DISTRO=ubuntu`, `TYPE=act`, and a valid `RUNNER` user, then re-run the build steps above.
## Licence
## License
Parts of this repository are from [actions/virtual-environments][actions/virtual-environments], used under the [MIT License](https://github.com/actions/virtual-environments/blob/main/LICENSE).
+2 -15
View File
@@ -146,26 +146,13 @@ if [ -z "$from_image" ] || [ -z "$from_tag" ]; then
exit 1
fi
if [ "$push" = true ]; then
# Combine tags and tag (if provided)
all_tags=$tags
if [ -n "$tag" ]; then
all_tags=$tags
if [ -n "$tag" ]; then
if [ -z "$all_tags" ]; then
all_tags=$tag
else
all_tags="$all_tags $tag"
fi
fi
else
# Even when not pushing, honor --tag so the local image is named.
all_tags=$tags
if [ -n "$tag" ]; then
if [ -z "$all_tags" ]; then
all_tags=$tag
else
all_tags="$all_tags $tag"
fi
fi
fi
# Buildx expects comma-separated --platform list; reuse platforms as-is.
+3 -19
View File
@@ -145,28 +145,12 @@ for ver in "${NODE[@]}"; do
done
case "$(uname -m)" in
'aarch64')
scripts=(
yq
)
;;
'x86_64')
scripts=(
yq
)
;;
'armv7l')
scripts=(
yq
)
;;
aarch64|x86_64|armv7l) ;;
*) exit 1 ;;
esac
for SCRIPT in "${scripts[@]}"; do
printf "\n\t🧨 Executing %s.sh 🧨\t\n" "${SCRIPT}"
bash "/imagegeneration/installers/${SCRIPT}.sh"
done
printf "\n\t🧨 Executing yq.sh 🧨\t\n"
bash "/imagegeneration/installers/yq.sh"
printf "\n\t🐋 Cleaning image 🐋\t\n"
apt-get clean
+12 -16
View File
@@ -27,20 +27,16 @@ download_with_retries() {
get_hash_from_remote_file() {
local url=$1
local keywords=("$2" "$3")
local delimiter=${4:-' '}
local word_number=${5:-1}
local matching_line
matching_line=$(curl -fsSL "$url" | sed 's/ */ /g' | tr -d '`')
for keyword in "${keywords[@]}"; do
matching_line=$(echo "$matching_line" | grep "$keyword" || true)
done
matching_line=$(echo "$matching_line" | head -n1)
if [ -z "$matching_line" ]; then
echo "Keywords (${keywords[*]}) not found in the file with hashes." >&2
local keyword=$2
local delimiter=${3:-' '}
local word_number=${4:-1}
local line
line=$(curl -fsSL "$url" | sed 's/ */ /g' | tr -d '`' | grep "$keyword" | head -n1 || true)
if [ -z "$line" ]; then
echo "Keyword ($keyword) not found in the file with hashes." >&2
exit 1
fi
echo "$matching_line" | cut -d "$delimiter" -f "$word_number" | tr -d -c '[:alnum:]'
echo "$line" | cut -d "$delimiter" -f "$word_number" | tr -d -c '[:alnum:]'
}
use_checksum_comparison() {
@@ -63,9 +59,9 @@ use_checksum_comparison() {
yq_arch() {
case "$(uname -m)" in
'aarch64') echo 'arm64' ;;
'x86_64') echo 'amd64' ;;
'armv7l') echo 'arm' ;;
aarch64) echo arm64 ;;
x86_64) echo amd64 ;;
armv7l) echo arm ;;
*) exit 1 ;;
esac
}
@@ -73,6 +69,6 @@ yq_arch() {
base_url="https://github.com/mikefarah/yq/releases/latest/download"
filename="yq_linux_$(yq_arch)"
download_with_retries "${base_url}/${filename}" "/tmp" "yq"
external_hash=$(get_hash_from_remote_file "${base_url}/checksums" "${filename} " "" " " "19")
external_hash=$(get_hash_from_remote_file "${base_url}/checksums" "${filename} " " " "19")
use_checksum_comparison "/tmp/yq" "${external_hash}"
sudo install /tmp/yq /usr/bin/yq