.gitlab-ci.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. before_script:
  2. - echo ">> LOADING..."
  3. after_script:
  4. - echo "-- FINISHED --"
  5. stages:
  6. - build
  7. - test
  8. build:
  9. stage: build
  10. script:
  11. - bundle install --without development
  12. - bundle exec rake db:setup RAILS_ENV=test
  13. - bundle exec rake db:migrate RAILS_ENV=test
  14. - bundle exec rake assets:precompile RAILS_ENV=test
  15. only:
  16. - master
  17. tags:
  18. - ci
  19. unit:
  20. script:
  21. - bundle exec rspec spec/models
  22. - bundle exec rspec spec/workers
  23. - bundle exec rspec spec/controllers
  24. stage: test
  25. only:
  26. - master
  27. except:
  28. - development
  29. tags:
  30. - ci
  31. allow_failure: false
  32. integration:
  33. script:
  34. - bundle exec rspec spec/features
  35. stage: test
  36. only:
  37. - master
  38. except:
  39. - development
  40. tags:
  41. - ci
  42. allow_failure: true
  43. #predeploy:
  44. # script:
  45. # - cap test deploy
  46. # stage: deploy
  47. # only:
  48. # - master
  49. # tags:
  50. # - ci
  51. # allow_failure: false
  52. #
  53. #deploy:
  54. # script:
  55. # - cap production deploy
  56. # stage: deploy
  57. # only:
  58. # - master
  59. # tags:
  60. # - ci
  61. # allow_failure: false
  62. variables:
  63. DATABASE_URL: "postgres://postgres:postgres@localhost/contactrocket"
  64. REDIS_URL: "redis://localhost:6379/0"
  65. ELASTICSEARCH_URL: "search-contactrocket-4v6tk3c5rhd3plrfsh277f6lcu.us-east-1.es.amazonaws.com"
  66. POSTGRES_DB: postgres
  67. POSTGRES_USER: postgres
  68. POSTGRES_PASSWORD: "postgres"