This repository has been archived by the owner on Dec 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
78 lines (72 loc) · 1.92 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
77
image: codeminer42/ci-ruby:2.6
stages:
- test
- security
- deploy
services:
- postgres:latest
cache:
key: Punchclock-123uf158
paths:
- .gitlab-cache/
variables:
RAILS_ENV: test
DATABASE_URL: postgresql://postgres:postgres@localhost
CC_TEST_REPORTER_ID: 60f18b69ac3904ddf5b3875523d020e1ed419e3f3d4a3bfa0e81420e03615137
POSTGRES_PASSWORD: postgres
rspec:
stage: test
before_script:
- apt-get -y update
- apt-get -y install google-chrome-stable
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
- source ~/.profile
- nvm install v12.4.0
- nvm use 12.4.0
- bundle install --without development production -j $(nproc)
- cp config/database.yml.example config/database.yml
- bundle exec rake db:create db:test:prepare
- npm install yarn --global
- yarn
- bundle exec rake webpacker:compile
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
coverage: '/\((\d+.\d+%)\) covered/'
script: bundle exec rake spec
artifacts:
paths:
- coverage/index.html
expire_in: 1 week
after_script:
- ./cc-test-reporter after-build --exit-code $?
brakeman:
stage: security
before_script:
- gem i bundler
- gem install brakeman
script:
- brakeman -z -q
bundler_audit:
stage: security
before_script:
- gem install bundler-audit
- bundle audit --update
script: bundle audit
production:
stage: deploy
script:
- apt-get update -qy
- apt-get install -y ruby-dev
- gem install dpl
- dpl --provider=heroku --api-key=$HEROKU_PRODUCTION_API_KEY --app=punchlock
when: manual
only:
- master
staging:
stage: deploy
script:
- gem install dpl
- dpl --provider=heroku --app=punchclock-staging --api-key=$HEROKU_PRODUCTION_API_KEY
only:
- master