.gitlab-ci.yml 893 Bytes
Newer Older
James Lopez's avatar
James Lopez committed
1
image: "ruby:2.1"
2 3 4 5 6 7

services:
  - mysql:latest
  - postgres:latest
  - redis:latest

8
cache:
9
  key: "ruby21"
10 11 12
  paths:
  - vendor

13 14 15
variables:
  MYSQL_ALLOW_EMPTY_PASSWORD: "1"

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
16
before_script:
17
  - source ./scripts/prepare_build.sh
Valery Sizov's avatar
Valery Sizov committed
18 19
  - ruby -v
  - which ruby
20
  - gem install bundler --no-ri --no-rdoc
Valery Sizov's avatar
Valery Sizov committed
21 22 23
  - cp config/gitlab.yml.example config/gitlab.yml
  - touch log/application.log
  - touch log/test.log
24
  - bundle install --without postgres production --jobs $(nproc)  "${FLAGS[@]}"
25
  - RAILS_ENV=test bundle exec rake db:drop db:create db:schema:load db:migrate
26

27 28 29 30
stages:
- test
- notifications

31
rubocop:
32
  stage: test
Valery Sizov's avatar
Valery Sizov committed
33 34 35 36 37 38
  script:
    - bundle exec rubocop
  tags:
    - ruby
    - mysql

39 40 41 42

notify:slack:
  stage: notifications
  script:
James Lopez's avatar
test  
James Lopez committed
43
    - ./scripts/notify_slack.sh "#ci-test" "Build failed! Check https://gitlab.com/gitlab-org/$(basename „$PWD)/commit/$CI_BUILD_REF/builds"
James Lopez's avatar
James Lopez committed
44
  when: on_failure