docs: archive entra materials and simplify deployment docs
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Phase 5: Container Registry Setup
|
||||
# Configure Azure Container Registry and attach to AKS
|
||||
# Phase 5: Local Artifact / Runtime Preparation
|
||||
# Prepare local image tags and artifact directories for the Phoenix-native deployment flow.
|
||||
#
|
||||
|
||||
set -euo pipefail
|
||||
@@ -10,55 +10,33 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "${SCRIPT_DIR}/config.sh"
|
||||
|
||||
log_info "=========================================="
|
||||
log_info "Phase 5: Container Registry Setup"
|
||||
log_info "Phase 5: Local Artifact / Runtime Preparation"
|
||||
log_info "=========================================="
|
||||
|
||||
# 5.1 Verify ACR exists
|
||||
log_step "5.1 Verifying Azure Container Registry..."
|
||||
log_step "5.1 Verifying local Docker runtime..."
|
||||
docker info >/dev/null || error_exit "Docker is not running"
|
||||
log_success "Docker runtime available"
|
||||
|
||||
ACR_EXISTS=$(az acr show \
|
||||
--name "${ACR_NAME}" \
|
||||
--resource-group "${AKS_RESOURCE_GROUP}" \
|
||||
--query name -o tsv 2>/dev/null || echo "")
|
||||
log_step "5.2 Preparing artifact directories..."
|
||||
mkdir -p "${ARTIFACTS_DIR}/images"
|
||||
log_success "Artifacts directory ready at ${ARTIFACTS_DIR}"
|
||||
|
||||
if [ -z "${ACR_EXISTS}" ]; then
|
||||
log_warning "ACR ${ACR_NAME} not found"
|
||||
log_info "ACR should be created by Terraform"
|
||||
log_info "Skipping ACR configuration"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
log_success "ACR found: ${ACR_NAME}"
|
||||
|
||||
# 5.2 Configure ACR access
|
||||
log_step "5.2 Configuring ACR access..."
|
||||
|
||||
# Enable admin user (or use managed identity)
|
||||
az acr update --name "${ACR_NAME}" --admin-enabled true \
|
||||
|| log_warning "Failed to enable admin user (may already be enabled)"
|
||||
|
||||
# 5.3 Attach ACR to AKS
|
||||
log_step "5.3 Attaching ACR to AKS..."
|
||||
|
||||
az aks update \
|
||||
--name "${AKS_NAME}" \
|
||||
--resource-group "${AKS_RESOURCE_GROUP}" \
|
||||
--attach-acr "${ACR_NAME}" \
|
||||
|| log_warning "Failed to attach ACR (may already be attached)"
|
||||
|
||||
log_success "ACR attached to AKS"
|
||||
|
||||
# 5.4 Test ACR access
|
||||
log_step "5.4 Testing ACR access..."
|
||||
|
||||
az acr login --name "${ACR_NAME}" || error_exit "Failed to login to ACR"
|
||||
|
||||
log_success "ACR access verified"
|
||||
log_step "5.3 Recording image naming convention..."
|
||||
{
|
||||
echo "IMAGE_REGISTRY=${IMAGE_REGISTRY}"
|
||||
echo "IMAGE_TAG=${IMAGE_TAG}"
|
||||
for service in "${SERVICES[@]}"; do
|
||||
echo "${service}=${IMAGE_REGISTRY}/${service}:${IMAGE_TAG}"
|
||||
done
|
||||
for app in "${APPS[@]}"; do
|
||||
echo "${app}=${IMAGE_REGISTRY}/${app}:${IMAGE_TAG}"
|
||||
done
|
||||
} > "${ARTIFACTS_DIR}/image-manifest-${ENVIRONMENT}.txt"
|
||||
log_success "Image manifest written to ${ARTIFACTS_DIR}/image-manifest-${ENVIRONMENT}.txt"
|
||||
|
||||
# Save state
|
||||
save_state "phase5" "complete"
|
||||
|
||||
log_success "=========================================="
|
||||
log_success "Phase 5: Container Registry - COMPLETE"
|
||||
log_success "Phase 5: Local Artifact / Runtime Preparation - COMPLETE"
|
||||
log_success "=========================================="
|
||||
|
||||
|
||||
Reference in New Issue
Block a user