Add Kubernetes and Argo CD deployment manifests

This commit is contained in:
Georgi Manchev
2026-09-29 02:02:14 +03:00
parent 9eee55162d
commit 81772adc59
6 changed files with 141 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
#!/usr/bin/env bash
set -euo pipefail
if [[ -z "${HIYV_GIT_REPO:-}" ]]; then
cat <<'EOF'
HIYV_GIT_REPO is not set, so no Argo CD Application was created.
Set it to the public Git repository containing the Kubernetes manifests, then
run this script again. For example:
export HIYV_GIT_REPO='<public Git repository URL>'
./scripts/create-argocd-application.sh
EOF
exit 0
fi
if ! command -v argocd >/dev/null 2>&1; then
echo "The argocd CLI is required and must be available in PATH." >&2
exit 1
fi
app_name="${HIYV_ARGOCD_APP_NAME:-hiyv}"
revision="${HIYV_GIT_REVISION:-main}"
manifest_path="${HIYV_MANIFEST_PATH:-k8s}"
destination_server="${HIYV_DESTINATION_SERVER:-https://kubernetes.default.svc}"
destination_namespace="${HIYV_DESTINATION_NAMESPACE:-hiyv}"
argocd app create "${app_name}" \
--upsert \
--repo "${HIYV_GIT_REPO}" \
--revision "${revision}" \
--path "${manifest_path}" \
--dest-server "${destination_server}" \
--dest-namespace "${destination_namespace}" \
--sync-policy automated \
--auto-prune \
--self-heal \
--sync-option CreateNamespace=true
echo "Argo CD Application '${app_name}' now tracks ${HIYV_GIT_REPO}@${revision}:${manifest_path}."