pre.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # Workaround to enable usage of mixed SSH and Docker GitLab CI runners
  2. .template_pre: &template_pre
  3. stage: pre
  4. extends:
  5. - .tags_docker
  6. - .rules_singletest
  7. before_script:
  8. - source /etc/profile.d/rvm.sh # ensure RVM is loaded
  9. rubocop:
  10. <<: *template_pre
  11. script:
  12. - bundle install -j $(nproc) --path vendor
  13. - bundle exec rubocop --parallel
  14. shellcheck:
  15. <<: *template_pre
  16. image: koalaman/shellcheck-alpine:stable
  17. before_script:
  18. - echo "Disable default before_script."
  19. script:
  20. - shellcheck -S warning $(find . -name "*.sh" -o -name "functions" | grep -v "/vendor/")
  21. zeitwerk_check:
  22. <<: *template_pre
  23. extends:
  24. - .tags_docker
  25. - .services_postgresql
  26. script:
  27. - bundle install -j $(nproc) --path vendor
  28. - bundle exec ruby script/build/database_config.rb
  29. - bundle exec rake zammad:db:init
  30. - bundle exec rails zeitwerk:check
  31. coffeelint:
  32. <<: *template_pre
  33. script:
  34. - coffeelint app/
  35. bundle-audit:
  36. <<: *template_pre
  37. script:
  38. - gem install bundler-audit
  39. - bundle-audit update
  40. - bundle-audit --ignore CVE-2015-9284
  41. github:
  42. <<: *template_pre
  43. tags:
  44. - deploy
  45. before_script:
  46. - "" # no RVM present in deploy ENV
  47. script:
  48. - script/build/sync_repo.sh git@github.com:zammad/zammad.git
  49. global_refresh_envs:
  50. extends:
  51. - .tags_docker
  52. - .services_postgresql
  53. stage: pre
  54. # ensure that only one Job runs in the whole project (branches etc.)
  55. resource_group: global_refresh_envs
  56. # allow download via the web UI to restore ENVs in case global cache got deleted (see: `.gitlab-ci.yml`)
  57. artifacts:
  58. expire_in: 1 day
  59. paths:
  60. - fresh.env
  61. rules:
  62. - if: $CI_MERGE_REQUEST_ID
  63. when: never
  64. - if: '$CI_COMMIT_BRANCH =~ /^private/'
  65. when: manual
  66. allow_failure: true
  67. - when: on_success
  68. script:
  69. - bundle exec rake zammad:ci:refresh_envs