.gitlab-ci.yml 1.33 KB
Newer Older
1 2
image: "dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.3-git-2.7-phantomjs-2.1"

3 4 5 6 7
stages:
  - test
  - deploy
  - automation

8 9 10
cache:
  key: "ruby-231"
  paths:
11
    - vendor/ruby
12

13
before_script:
14
  - bundle install --jobs=$(nproc) --retry=3 --path=vendor
15

Robert Speicher's avatar
Robert Speicher committed
16 17 18 19 20
rubocop:
  stage: test
  script:
    - bundle exec rubocop

21 22
specs:
  stage: test
Rémy Coutable's avatar
Rémy Coutable committed
23
  retry: 1
Robert Speicher's avatar
Robert Speicher committed
24
  script:
25
    - cp .env.example .env
26 27
    - git config --global user.email "[email protected]"
    - git config --global user.name "Your Name"
Robert Speicher's avatar
Robert Speicher committed
28
    - bundle exec rake
29 30 31 32 33 34 35
  artifacts:
    paths:
      - coverage/assets
      - coverage/index.html

pages:
  stage: deploy
36
  before_script: []
37
  script:
38
    - mkdir -p public/
39 40 41 42 43 44
    - mv coverage/ public/
  dependencies:
    - specs
  artifacts:
    paths:
      - public/
45 46
  only:
    - master
47 48 49 50 51
  except:
    - schedules

upstream-merge:
  stage: automation
52
  script:
53 54 55 56 57 58
    - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
    - eval $(ssh-agent -s)
    - echo "$AUTO_UPSTREAM_MERGE_BOT_SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
    - git config --global user.email "[email protected]"
    - git config --global user.name "GitLab Bot"
    - mkdir -p ~/.ssh
59
    - chmod 700 ~/.ssh
60
    - ssh-keyscan gitlab.com >> ~/.ssh/known_hosts
61
    - chmod 644 ~/.ssh/known_hosts
62 63 64
    - bundle exec rake upstream_merge
  only:
    - schedules