fix(deploy): sync ivr prompt wavs to server

This commit is contained in:
Yera All
2026-04-08 16:00:49 +05:00
parent bfaec370f9
commit ba0e1143ca
5 changed files with 35 additions and 1 deletions
Binary file not shown.
Binary file not shown.
+9 -1
View File
@@ -173,7 +173,15 @@ deploy-production:
- rsync -av deployment/ "$DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH/deployment/"
- |
ssh "$DEPLOY_USER@$DEPLOY_HOST" \
"mkdir -p '$DEPLOY_PATH/.data_local/generated_ivr_yandex/ivr' '$DEPLOY_PATH/.data_local/recordings' '$DEPLOY_PATH/.asterisk_assets'"
"mkdir -p '$DEPLOY_PATH/.data_local/generated_ivr_yandex/ivr' '$DEPLOY_PATH/.data_local/recordings' '$DEPLOY_PATH/.asterisk_assets/ivr'"
- |
if [ -d .asterisk_assets/ ]; then
rsync -av .asterisk_assets/ "$DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH/.asterisk_assets/"
fi
- |
if [ -d .asterisk_assets/ivr/ ]; then
rsync -av --delete .asterisk_assets/ivr/ "$DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH/.data_local/generated_ivr_yandex/ivr/"
fi
- |
ssh "$DEPLOY_USER@$DEPLOY_HOST" \
"printf 'APP_IMAGE=%s\nASTERISK_IMAGE=%s\n' '$APP_IMAGE' '$ASTERISK_IMAGE' > '$DEPLOY_PATH/deployment/.env.images'"
+7
View File
@@ -102,6 +102,13 @@ if [[ ! -f "$DEPLOY_DIR/.env.production" ]]; then
fi
install -d "$DEPLOY_DIR/.data_local"
install -d "$DEPLOY_DIR/.data_local/generated_ivr_yandex/ivr"
if [[ -d "$DEPLOY_DIR/.asterisk_assets/ivr" ]]; then
rsync -a --delete \
"$DEPLOY_DIR/.asterisk_assets/ivr/" \
"$DEPLOY_DIR/.data_local/generated_ivr_yandex/ivr/"
fi
export CALL_CENTER_IMAGE="${APP_IMAGE_NAME}:${APP_IMAGE_TAG}"
export COMPOSE_PROJECT_NAME="${COMPOSE_PROJECT_NAME:-call-center}"
+19
View File
@@ -0,0 +1,19 @@
from pathlib import Path
def test_source_deploy_syncs_versioned_ivr_assets_into_runtime_data_dir():
root = Path(__file__).resolve().parents[1]
script = (root / "scripts" / "deploy_gitlab.sh").read_text(encoding="utf-8")
assert '.data_local/generated_ivr_yandex/ivr' in script
assert '.asterisk_assets/ivr' in script
assert 'rsync -a --delete \\' in script
def test_registry_deploy_syncs_asterisk_assets_and_ivr_wavs():
root = Path(__file__).resolve().parents[1]
ci = (root / ".gitlab-ci.yml").read_text(encoding="utf-8")
assert "$DEPLOY_PATH/.asterisk_assets/ivr" in ci
assert ".asterisk_assets/ivr/" in ci
assert "$DEPLOY_PATH/.data_local/generated_ivr_yandex/ivr/" in ci