pre.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # Write CI cache once for faster runs
  2. 'write runner cache: ruby':
  3. stage: pre
  4. cache: !reference [.cache, read_write_ruby]
  5. before_script:
  6. - !reference [.scripts, source_rvm]
  7. script:
  8. - !reference [.scripts, bundle_install]
  9. 'write runner cache: nodejs':
  10. stage: pre
  11. cache: !reference [.cache, read_write_nodejs]
  12. before_script: []
  13. script:
  14. - !reference [.scripts, yarn_install]
  15. - yarn storybook:install
  16. - yarn cypress:install
  17. - yarn --cwd ./.eslint-plugin-zammad install
  18. # Executed on a dedicated runner.
  19. 'push to github':
  20. stage: pre
  21. cache: []
  22. before_script:
  23. - test -d $HOME/.ssh || mkdir $HOME/.ssh
  24. - ssh-keyscan github.com >> $HOME/.ssh/known_hosts
  25. - eval $(ssh-agent -s)
  26. - echo "$PUSH_TO_GITHUB_SSH_PRIVATE_KEY" | ssh-add -
  27. - ssh-add -l
  28. script:
  29. - git fetch --unshallow
  30. - script/build/sync_repo.sh git@github.com:zammad/zammad.git
  31. 'refresh global envs':
  32. services:
  33. - !reference [.services, postgresql]
  34. stage: pre
  35. needs:
  36. - 'write runner cache: ruby'
  37. # ensure that only one Job runs in the whole project (branches etc.)
  38. resource_group: global_refresh_envs
  39. # allow download via the web UI to restore ENVs in case global cache got deleted (see: `.gitlab-ci.yml`)
  40. artifacts:
  41. expire_in: 1 week
  42. paths:
  43. - fresh.env
  44. rules:
  45. - if: $CI_MERGE_REQUEST_ID
  46. when: never
  47. - if: '$CI_COMMIT_BRANCH =~ /^private/'
  48. when: manual
  49. allow_failure: true
  50. - when: on_success
  51. script:
  52. - bundle exec rake zammad:ci:refresh_envs