.gitlab-ci.yml 893 字节
Newer Older
J
James Lopez 已提交
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"

D
Dmitriy Zaporozhets 已提交
16
before_script:
K
Kamil Trzcinski 已提交
17
  - source ./scripts/prepare_build.sh
V
Valery Sizov 已提交
18 19
  - ruby -v
  - which ruby
20
  - gem install bundler --no-ri --no-rdoc
V
Valery Sizov 已提交
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
V
Valery Sizov 已提交
33 34 35 36 37 38
  script:
    - bundle exec rubocop
  tags:
    - ruby
    - mysql

39 40 41 42

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