fix docker build

This commit is contained in:
Ronald A. Richardson
2025-05-20 10:06:26 +08:00
parent 2b959db773
commit c59f028755
6 changed files with 9 additions and 28 deletions

View File

@@ -4,12 +4,15 @@ on:
push:
tags:
- 'v*'
workflow_dispatch: # 👈 enables manual trigger
workflow_dispatch:
inputs:
branch:
description: 'Branch to build from'
required: false
default: 'main'
version:
description: 'Image version tag (e.g., v0.7.1-beta)'
required: false
jobs:
docker-release:
@@ -18,7 +21,7 @@ jobs:
env:
REGISTRY: fleetbase
VERSION: ${{ github.event.inputs.branch || github.ref_name || 'manual' }}
VERSION: ${{ github.event.inputs.version || (github.ref_type == 'tag' && startsWith(github.ref_name, 'v') && github.ref_name) || 'manual' }}
steps:
- name: Checkout Repo

View File

@@ -33,7 +33,7 @@ function coerceValue(key, value) {
return toBoolean(value);
case 'EXTENSIONS':
return typeof value === 'string' ? value.split(',') : [value];
return typeof value === 'string' ? value.split(',') : Array.from(value);
default:
return value;

View File

@@ -3,7 +3,7 @@
FROM dunglas/frankenphp:1.5.0-php8.2-bookworm AS base
# Install packages
RUN apt-get update && apt-get install -y git bind9-utils mycli nodejs npm nano \
RUN apt-get update && apt-get install -y git bind9-utils mycli nodejs npm nano uuid-runtime \
&& mkdir -p /root/.ssh \
&& ssh-keyscan github.com >> /root/.ssh/known_hosts
@@ -133,21 +133,18 @@ RUN chmod -R 755 /fleetbase/api/storage
# Set permissions for deploy script
RUN chmod +x /fleetbase/api/deploy.sh
# Scheduler base stage
FROM base AS scheduler-base
# Install go-crond
RUN curl -L https://github.com/webdevops/go-crond/releases/download/23.12.0/go-crond.linux.amd64 > /usr/local/bin/go-crond && chmod +x /usr/local/bin/go-crond
COPY docker/crontab ./crontab
RUN chmod 0600 ./crontab
# Scheduler dev stage
FROM scheduler-base AS scheduler-dev
FROM base AS scheduler-dev
ENTRYPOINT []
CMD ["go-crond", "--verbose", "root:./crontab"]
# Scheduler stage
FROM scheduler-base AS scheduler
FROM base AS scheduler
ENTRYPOINT ["/sbin/ssm-parent", "-c", ".ssm-parent.yaml", "run", "--"]
CMD ["go-crond", "--verbose", "root:./crontab"]

View File

@@ -1,14 +0,0 @@
#!/bin/sh
CURRENT_HASH_FILE="./EXPECTED_HASH"
CURRENT_HASH=$(git rev-parse HEAD)
EXISTING_HASH=$(cat "$CURRENT_HASH_FILE" 2>/dev/null || echo "")
if [ "$CURRENT_HASH" = "$EXISTING_HASH" ]; then
echo "✅ EXPECTED_HASH is already up to date."
exit 0
fi
echo "⚙️ Writing current commit hash to CURRENT_HASH..."
echo "$CURRENT_HASH" > "$CURRENT_HASH_FILE"
git add "$CURRENT_HASH_FILE"

View File

@@ -1,5 +0,0 @@
#!/bin/bash
cp ./scripts/pre-commit-hook.sh .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
echo "✅ Git hook installed."