diff --git a/.github/workflows/lead-region-ops.yml b/.github/workflows/lead-region-ops.yml index 05360179..a2901f27 100644 --- a/.github/workflows/lead-region-ops.yml +++ b/.github/workflows/lead-region-ops.yml @@ -53,6 +53,11 @@ on: required: false default: true type: boolean + force: + description: 'import: принудительно (--force, игнорировать «реестр идентичен»)' + required: false + default: false + type: boolean phone: description: 'smoke: телефон' required: false @@ -77,6 +82,7 @@ jobs: URL: ${{ github.event.inputs.url }} DIR: ${{ github.event.inputs.dir }} DRY: ${{ github.event.inputs.dry_run }} + FORCE: ${{ github.event.inputs.force }} PHONE: ${{ github.event.inputs.phone }} steps: @@ -344,12 +350,14 @@ jobs: run: | DRY_FLAG="" if [ "${DRY}" = "true" ]; then DRY_FLAG="--dry-run"; fi + FORCE_FLAG="" + if [ "${FORCE}" = "true" ]; then FORCE_FLAG="--force"; fi ssh -i ~/.ssh/liderra_deploy "${LIDERRA_USER}@${LIDERRA_HOST}" \ - "APP_DIR='$APP_DIR' DIR='$DIR' DRY_FLAG='$DRY_FLAG' bash -s" <<'REMOTE' | tee /tmp/op.log + "APP_DIR='$APP_DIR' DIR='$DIR' DRY_FLAG='$DRY_FLAG' FORCE_FLAG='$FORCE_FLAG' bash -s" <<'REMOTE' | tee /tmp/op.log set -e cd "$APP_DIR" - echo "=== phone-ranges:import --dir=${DIR} ${DRY_FLAG} ===" - sudo -u www-data php artisan phone-ranges:import --dir="$DIR" $DRY_FLAG 2>&1 + echo "=== phone-ranges:import --dir=${DIR} ${DRY_FLAG} ${FORCE_FLAG} ===" + sudo -u www-data php artisan phone-ranges:import --dir="$DIR" $DRY_FLAG $FORCE_FLAG 2>&1 echo "=== Счётчики ===" sudo -u postgres psql -d liderra -c "SELECT count(*) AS phone_ranges FROM phone_ranges" 2>&1 || true # staging-счётчик: 2 отдельных запроса, чтобы Postgres не парсил