agent-factory: generate agent auto-retrieve-files-from-a-reposito

This commit is contained in:
2026-04-13 20:00:51 +00:00
parent 56916f44cf
commit 940e2a5b80
19 changed files with 569 additions and 0 deletions

54
scripts/deploy.sh Normal file
View File

@@ -0,0 +1,54 @@
#!/bin/bash
# deploy.sh — Build auto-retrieve-files-from-a-reposito image in ACR and deploy to AKS
set -e
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
ACR_NAME="bstagecjotdevacr"
APP_NAME="auto-retrieve-files-from-a-reposito"
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-retrieve-files-from-a-reposito — 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"