-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
76 lines (68 loc) · 1.67 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
image: ruby:2.6.3
variables:
RAILS_ENV: test
NODE_VERSION: 8.0.0
POSTGRES_DB: playground5
DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB"
stages:
- lint
- test
- deploy
cache:
paths:
- vendor/ruby
- node_modules
rubocop:
stage: lint
before_script:
- bundle install --path vendor
script:
- bundle exec rubocop
except:
- schedules
brakeman:
stage: lint
before_script:
- export LANG=C.UTF-8
- export LC_ALL=C.UTF-8
- gem install brakeman
script:
- brakeman
except:
- schedules
bundler-audit:
stage: lint
before_script:
- gem install bundler-audit
- bundle audit --update --ignore CVE-2015-9284 # Ignore OmniAuth CVE
script:
- bundle audit --ignore CVE-2015-9284 # Ignore OmniAuth CVE
allow_failure: true
rspec:
stage: test
before_script:
- curl -SLO https://nodejs.org/dist/v$NODE_VERSION/node-v${NODE_VERSION}-linux-x64.tar.xz && tar -xJf node-v${NODE_VERSION}-linux-x64.tar.xz -C /usr/local --strip-components=1;
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH
- bundle install --without development --path vendor
- yarn install
services:
- postgres:9.6
script:
- bundle exec rake db:migrate
- bundle exec rspec
except:
- schedules
deploy:
stage: deploy
before_script:
- which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
- eval $(ssh-agent -s)
- ssh-add <(echo -e "$SSH_PRIVATE_KEY")
- bundle install --path vendor
script:
- bundle exec cap production deploy
only:
- master
except:
- schedules