Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

36 строки
1.2 KiB

  1. #!/bin/bash
  2. # SPDX-FileCopyrightText: 2026 Slavi Pantaleev
  3. #
  4. # SPDX-License-Identifier: AGPL-3.0-or-later
  5. # Ensures that the migration validated version in examples/vars.yml
  6. # matches the expected version in the matrix_playbook_migration role defaults.
  7. set -euo pipefail
  8. defaults_file="roles/custom/matrix_playbook_migration/defaults/main.yml"
  9. examples_file="examples/vars.yml"
  10. expected_version=$(grep -oP '^matrix_playbook_migration_expected_version:\s*"?\K[^"]+' "$defaults_file")
  11. examples_version=$(grep -oP '^matrix_playbook_migration_validated_version:\s*"?\K[^"]+' "$examples_file")
  12. if [ -z "$expected_version" ]; then
  13. echo "ERROR: Could not extract matrix_playbook_migration_expected_version from $defaults_file"
  14. exit 1
  15. fi
  16. if [ -z "$examples_version" ]; then
  17. echo "ERROR: Could not extract matrix_playbook_migration_validated_version from $examples_file"
  18. exit 1
  19. fi
  20. if [ "$expected_version" != "$examples_version" ]; then
  21. echo "ERROR: Migration version mismatch!"
  22. echo " $defaults_file has expected version: $expected_version"
  23. echo " $examples_file has validated version: $examples_version"
  24. echo ""
  25. echo "Please update $examples_file to match."
  26. exit 1
  27. fi