feat: add S3 configuration and utility functions for blog image handling
All checks were successful
CI - Build and Push / Build and Push Docker Image (push) Successful in 17s
All checks were successful
CI - Build and Push / Build and Push Docker Image (push) Successful in 17s
This commit is contained in:
20
script/ci.sh
20
script/ci.sh
@@ -13,6 +13,10 @@ CONTAINER_REGISTRY_PASSWORD="${CONTAINER_REGISTRY_PASSWORD:-password}"
|
||||
CONTAINER_IMAGE_NAME="${CONTAINER_IMAGE_NAME:-image-name}"
|
||||
CONTAINER_IMAGE_TAG="${CONTAINER_IMAGE_TAG:-latest}"
|
||||
|
||||
# Application Environment Variables
|
||||
VITE_S3_ENDPOINT_BLOG="${VITE_S3_ENDPOINT_BLOG:-}"
|
||||
VITE_S3_BUCKET_BLOG="${VITE_S3_BUCKET_BLOG:-}"
|
||||
|
||||
# =============================================================================
|
||||
# Functions
|
||||
# =============================================================================
|
||||
@@ -33,6 +37,8 @@ print_help() {
|
||||
echo " CONTAINER_REGISTRY_PASSWORD Registry password (default: password)"
|
||||
echo " CONTAINER_IMAGE_NAME Image name (default: image-name)"
|
||||
echo " CONTAINER_IMAGE_TAG Image tag (default: latest)"
|
||||
echo " VITE_S3_ENDPOINT_BLOG S3 endpoint for blog images"
|
||||
echo " VITE_S3_BUCKET_BLOG S3 bucket for blog images"
|
||||
echo ""
|
||||
echo "Examples:"
|
||||
echo " $0 build"
|
||||
@@ -51,8 +57,20 @@ build_image() {
|
||||
echo "Image: ${FULL_IMAGE_NAME}"
|
||||
echo ""
|
||||
|
||||
# Prepare build args for S3 configuration
|
||||
BUILD_ARGS=""
|
||||
if [ -n "${VITE_S3_ENDPOINT_BLOG}" ]; then
|
||||
BUILD_ARGS="${BUILD_ARGS} --build-arg VITE_S3_ENDPOINT_BLOG=${VITE_S3_ENDPOINT_BLOG}"
|
||||
echo "S3 Endpoint (Blog): ${VITE_S3_ENDPOINT_BLOG}"
|
||||
fi
|
||||
if [ -n "${VITE_S3_BUCKET_BLOG}" ]; then
|
||||
BUILD_ARGS="${BUILD_ARGS} --build-arg VITE_S3_BUCKET_BLOG=${VITE_S3_BUCKET_BLOG}"
|
||||
echo "S3 Bucket (Blog): ${VITE_S3_BUCKET_BLOG}"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# Build the Docker image using Dockerfile in current directory
|
||||
docker build -t "${FULL_IMAGE_NAME}" .
|
||||
docker build ${BUILD_ARGS} -t "${FULL_IMAGE_NAME}" .
|
||||
|
||||
# Check if build was successful
|
||||
if [ $? -eq 0 ]; then
|
||||
|
||||
Reference in New Issue
Block a user