agent-factory: generate agent auto-parse-email-content-and-extrac
This commit is contained in:
54
scripts/deploy.sh
Normal file
54
scripts/deploy.sh
Normal file
@@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
# deploy.sh — Build auto-parse-email-content-and-extrac image in ACR and deploy to AKS
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
ACR_NAME="bstagecjotdevacr"
|
||||
APP_NAME="auto-parse-email-content-and-extrac"
|
||||
NAMESPACE="agents"
|
||||
VERSION_FILE="${SCRIPT_DIR}/../.image-version"
|
||||
TAG=""
|
||||
|
||||
while [[ "$#" -gt 0 ]]; do
|
||||
case $1 in
|
||||
--tag) TAG="$2"; shift ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ -z "$TAG" ]; then
|
||||
if [ -f "$VERSION_FILE" ]; then
|
||||
CURRENT_VERSION=$(cat "$VERSION_FILE")
|
||||
else
|
||||
CURRENT_VERSION="1.0.0"
|
||||
fi
|
||||
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
|
||||
PATCH=$((PATCH + 1))
|
||||
TAG="${MAJOR}.${MINOR}.${PATCH}"
|
||||
echo "$TAG" > "$VERSION_FILE"
|
||||
fi
|
||||
|
||||
IMAGE="${ACR_NAME}.azurecr.io/${APP_NAME}:${TAG}"
|
||||
|
||||
echo "======================================================================"
|
||||
echo " auto-parse-email-content-and-extrac — Build & Deploy"
|
||||
echo " Image: ${IMAGE}"
|
||||
echo "======================================================================"
|
||||
|
||||
az acr build --registry ${ACR_NAME} \
|
||||
--image ${APP_NAME}:${TAG} \
|
||||
--image ${APP_NAME}:latest \
|
||||
"${SCRIPT_DIR}/.."
|
||||
|
||||
kubectl apply -f "${SCRIPT_DIR}/../k8s/configmap.yaml" 2>/dev/null || true
|
||||
kubectl apply -f "${SCRIPT_DIR}/../k8s/deployment.yaml"
|
||||
kubectl apply -f "${SCRIPT_DIR}/../k8s/service.yaml" 2>/dev/null || true
|
||||
|
||||
kubectl set image deployment/${APP_NAME} \
|
||||
${APP_NAME}=${IMAGE} \
|
||||
-n ${NAMESPACE}
|
||||
|
||||
kubectl rollout status deployment/${APP_NAME} -n ${NAMESPACE} --timeout=120s
|
||||
|
||||
echo "✓ Done. Image: ${IMAGE}"
|
||||
echo " Port forward: kubectl port-forward -n ${NAMESPACE} deployment/${APP_NAME} 8080:8080"
|
||||
Reference in New Issue
Block a user