migration.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #
  2. # Test the migration from the previous `stable` branch to `develop`.
  3. #
  4. .template_migration:
  5. stage: test
  6. rules:
  7. - if: $CI_COMMIT_REF_NAME =~ /^stable/
  8. when: never
  9. - if: $CI_COMMIT_REF_NAME =~ /^(private|cherry-pick-)/
  10. when: manual
  11. allow_failure: true
  12. - when: on_success
  13. before_script: []
  14. script:
  15. # First, checkout stable and set it up.
  16. - git fetch --unshallow
  17. - git checkout stable
  18. - !reference [.scripts, source_rvm]
  19. - rvm use 3.1.3
  20. - !reference [.scripts, bundle_install]
  21. - !reference [.scripts, configure_environment]
  22. - !reference [.scripts, zammad_db_init]
  23. # Then, switch to the current commit, migrate to it and run a few selected tests.
  24. - git checkout $CI_COMMIT_SHA
  25. - rvm use 3.2.3
  26. - !reference [.scripts, bundle_install]
  27. # Force redis usage, even if it was disabled by the initial configure_environment script of stable.
  28. - export REDIS_URL=redis://redis
  29. - bundle exec rails db:migrate
  30. - bundle exec rspec --profile 10 spec/db
  31. rspec:migration:postgresql:
  32. extends:
  33. - .template_migration
  34. services:
  35. - !reference [.services, postgresql]
  36. - !reference [.services, redis]
  37. rspec:migration:mysql:
  38. extends:
  39. - .template_migration
  40. services:
  41. - !reference [.services, mysql]
  42. - !reference [.services, redis]
  43. rspec:migration:mariadb:
  44. extends:
  45. - .template_migration
  46. services:
  47. - !reference [.services, mariadb]
  48. - !reference [.services, redis]