Handling separation of concerns for the CICD.
Signed-off-by: copilotcoder <copilotcoder@darkhelm.org>
This commit is contained in:
@@ -16,6 +16,7 @@ NC='\033[0m' # No Color
|
||||
BASE_IMAGE_TAG="cicd-base:local"
|
||||
COMPLETE_IMAGE_TAG="cicd:local"
|
||||
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
BASE_HASH_HELPER="$PROJECT_DIR/scripts/compute-cicd-base-hash.sh"
|
||||
TEMP_SSH_KEY="/tmp/cicd_build_ssh_key"
|
||||
|
||||
# Functions
|
||||
@@ -93,6 +94,11 @@ check_requirements() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -x "$BASE_HASH_HELPER" ]]; then
|
||||
log_error "Base hash helper is missing or not executable: $BASE_HASH_HELPER"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log_success "Requirements check passed"
|
||||
}
|
||||
|
||||
@@ -107,8 +113,8 @@ build_base_image() {
|
||||
|
||||
local start_time=$(date +%s)
|
||||
|
||||
# Calculate base Dockerfile hash for tagging
|
||||
local base_hash=$(sha256sum "$PROJECT_DIR/Dockerfile.cicd-base" | cut -d' ' -f1 | head -c16)
|
||||
# Calculate the canonical base hash used by CI and local builds.
|
||||
local base_hash=$("$BASE_HASH_HELPER")
|
||||
log_info "Base Dockerfile hash: $base_hash"
|
||||
|
||||
# Build base image
|
||||
@@ -129,7 +135,9 @@ build_base_image() {
|
||||
# Show image size
|
||||
local image_size=$(docker images --format "table {{.Repository}}:{{.Tag}}\t{{.Size}}" | grep "$BASE_IMAGE_TAG" | awk '{print $2}')
|
||||
log_info "Base image size: $image_size (includes Playwright browsers)"
|
||||
}build_complete_image() {
|
||||
}
|
||||
|
||||
build_complete_image() {
|
||||
log_info "Building CICD complete image..."
|
||||
|
||||
# Check if base image exists
|
||||
|
||||
Reference in New Issue
Block a user