Sync runner checkout / sync (push) Successful in 6s
## Summary - Register `scha` in `app_catalog` and `host_apps` on adama, roslin, and ai-server-4080 (prod port **8002**; beta **8012** reserved). - Update `IMPLEMENTATION.md` ports, apps, Postgres, and NPM tables so every app lists beta + prod. - Include `scha` in `deploy.sh` help. Part A (dockerize / CI in the `scha` repo) is tracked separately in [scha#19](ai_ml_operations/scha#19). ## Test plan - [ ] Confirm inventory YAML loads: `ansible-inventory --list` shows `scha` under each host - [ ] After Part A merges + `~/Documents/secrets/scha/scha_prod.env` exists: dry-run `./scripts/deploy.sh --app scha --env prod --check` - [ ] Create DB `scha` on shared Postgres (`10.0.0.230`) and point NPM at `adama:8002` + `roslin:8002` (+ optional `ai-server-4080:8002`) Reviewed-on: #3
91 lines
1.8 KiB
Bash
Executable File
91 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
cd "$REPO_ROOT"
|
|
|
|
LIMIT=""
|
|
EXTRA_ARGS=()
|
|
EXTRA_VARS=()
|
|
|
|
usage() {
|
|
cat <<EOF
|
|
Usage: $(basename "$0") [HOST] [OPTIONS]
|
|
|
|
Deploy applications with deploy-apps.yml.
|
|
|
|
HOST Optional. Limit to one host: adama, roslin, or ai-server-4080.
|
|
|
|
Options:
|
|
--app NAME App to deploy (company_site, dta_service, dta_webapp, scha)
|
|
--env ENV Environment: beta or prod
|
|
--ref REF Git ref/sha to deploy (default: master)
|
|
--check Dry run
|
|
--diff Show diffs
|
|
--extra-vars V Pass raw extra vars
|
|
-h, --help Show this help
|
|
|
|
Examples:
|
|
# CI: deploy one app+env at a pinned sha
|
|
$(basename "$0") --app company_site --env prod --ref abc123
|
|
|
|
# Redeploy everything on master (all hosts)
|
|
$(basename "$0")
|
|
|
|
# Dry run for one host
|
|
$(basename "$0") adama --check
|
|
EOF
|
|
}
|
|
|
|
while [[ $# -gt 0 ]]; do
|
|
case "$1" in
|
|
-h|--help)
|
|
usage
|
|
exit 0
|
|
;;
|
|
--app)
|
|
EXTRA_VARS+=(-e "app=$2")
|
|
shift 2
|
|
;;
|
|
--env)
|
|
EXTRA_VARS+=(-e "app_env=$2")
|
|
shift 2
|
|
;;
|
|
--ref)
|
|
EXTRA_VARS+=(-e "app_ref=$2")
|
|
shift 2
|
|
;;
|
|
--check)
|
|
EXTRA_ARGS+=(--check)
|
|
shift
|
|
;;
|
|
--diff)
|
|
EXTRA_ARGS+=(--diff)
|
|
shift
|
|
;;
|
|
--extra-vars)
|
|
EXTRA_VARS+=(-e "$2")
|
|
shift 2
|
|
;;
|
|
adama|roslin|ai-server-4080)
|
|
LIMIT="$1"
|
|
shift
|
|
;;
|
|
*)
|
|
echo "Unknown argument: $1" >&2
|
|
usage >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
done
|
|
|
|
CMD=(ansible-playbook playbooks/deploy-apps.yml "${EXTRA_ARGS[@]}" "${EXTRA_VARS[@]}")
|
|
if [[ -n "$LIMIT" ]]; then
|
|
CMD+=(--limit "$LIMIT")
|
|
echo "==> Deploying to: $LIMIT"
|
|
else
|
|
echo "==> Deploying to all webservers"
|
|
fi
|
|
|
|
exec "${CMD[@]}"
|