- New Build and startup procedures for all services, compliant for both docker, podman and k8s
This commit is contained in:
@@ -34,12 +34,16 @@ ACTION="both"
|
||||
NO_CACHE=""
|
||||
PROGRESS=""
|
||||
DEBUG=""
|
||||
BUILD_BASE=""
|
||||
BASE_ONLY=""
|
||||
|
||||
# Function to display usage information
|
||||
usage() {
|
||||
echo "Usage: $0 [-b|-p] [--no-cache] [--progress=plain] [--debug] [service1 service2 ...]"
|
||||
echo "Usage: $0 [-b|-p|-bb|--base-only] [--no-cache] [--progress=plain] [--debug] [service1 service2 ...]"
|
||||
echo " -b: Build only"
|
||||
echo " -p: Push only"
|
||||
echo " -bb: Build base image (in addition to services)"
|
||||
echo " --base-only: Build only base image (skip services)"
|
||||
echo " --no-cache: Perform a clean build without using cache"
|
||||
echo " --progress=plain: Show detailed progress of the build"
|
||||
echo " --debug: Enable debug mode for the build"
|
||||
@@ -59,6 +63,14 @@ while [[ $# -gt 0 ]]; do
|
||||
ACTION="push"
|
||||
shift
|
||||
;;
|
||||
-bb)
|
||||
BUILD_BASE="true"
|
||||
shift
|
||||
;;
|
||||
--base-only)
|
||||
BASE_ONLY="true"
|
||||
shift
|
||||
;;
|
||||
--no-cache)
|
||||
NO_CACHE="--no-cache"
|
||||
shift
|
||||
@@ -82,6 +94,41 @@ while [[ $# -gt 0 ]]; do
|
||||
esac
|
||||
done
|
||||
|
||||
# Function to build base image
|
||||
build_base_image() {
|
||||
echo "🏗️ Building base image..."
|
||||
local BASE_IMAGE_NAME="$REGISTRY/$ACCOUNT/eveai-base:$TAG"
|
||||
|
||||
echo "Building base image for platform: $PLATFORM"
|
||||
echo "Base image tag: $BASE_IMAGE_NAME"
|
||||
|
||||
podman build \
|
||||
--platform "$PLATFORM" \
|
||||
$NO_CACHE \
|
||||
$PROGRESS \
|
||||
$DEBUG \
|
||||
-t "$ACCOUNT/eveai-base:$TAG" \
|
||||
-t "$BASE_IMAGE_NAME" \
|
||||
-f Dockerfile.base \
|
||||
..
|
||||
|
||||
if [ "$ACTION" = "push" ] || [ "$ACTION" = "both" ]; then
|
||||
echo "Pushing base image to registry..."
|
||||
podman push "$BASE_IMAGE_NAME"
|
||||
fi
|
||||
|
||||
echo "✅ Base image built successfully"
|
||||
}
|
||||
|
||||
# Function to check if we should build base image
|
||||
should_build_base() {
|
||||
if [ "$BUILD_BASE" = "true" ] || [ "$BASE_ONLY" = "true" ]; then
|
||||
return 0 # true
|
||||
else
|
||||
return 1 # false
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to build and/or push a service
|
||||
process_service() {
|
||||
local SERVICE="$1"
|
||||
@@ -167,6 +214,20 @@ else
|
||||
SERVICES=("$@")
|
||||
fi
|
||||
|
||||
# Handle base-only mode
|
||||
if [ "$BASE_ONLY" = "true" ]; then
|
||||
echo "🎯 Base-only mode: Building only base image"
|
||||
build_base_image
|
||||
echo -e "\033[32m✅ Base image build completed!\033[0m"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Build base image if requested
|
||||
if should_build_base; then
|
||||
build_base_image
|
||||
echo "" # Empty line for readability
|
||||
fi
|
||||
|
||||
echo "Using simplified AMD64-only approach for maximum compatibility..."
|
||||
echo "Images will be tagged as: $REGISTRY/$ACCOUNT/[service]:$TAG"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user