-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
99 lines (86 loc) · 1.78 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
99 lines (86 loc) · 1.78 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
workflow:
rules:
- if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
when: never
- when: always
.except_schedules:
rules:
- if: '$CI_PIPELINE_SOURCE != "schedule"'
when: always
.production:
extends:
- .default-tags
environment:
name: production
url: https://www.theater-kaisersesch.de
.default-tags:
tags: [ruby-3.4]
.postgres:
tags:
- ruby-3.4
- postgres
.bundle: &bundle
- bundle config set --local without development
- bundle install -j $(sysctl -n hw.ncpu)
stages:
- test
- deploy
- post-deploy
variables:
RAILS_ENV: test
RUBOCOP_CACHE_ROOT: .cache/rubocop
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- .cache
- public/assets
rubocop:
extends:
- .except_schedules
- .default-tags
before_script:
- *bundle
script:
- rubocop --color
specs:
extends:
- .except_schedules
- .postgres
before_script:
- *bundle
script:
- rails db:drop db:create db:schema:load
- rails assets:precompile
- rspec --tty --color
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_PIPELINE_ID"
expose_as: 'SimpleCov report'
paths:
- 'coverage/'
expire_in: 1 week
bundler audit:
extends: .default-tags
script:
- gem install bundler-audit
- bundle audit check --update
deploy:
extends:
- .production
stage: deploy
before_script:
- *bundle
script:
- ssh_wrap cap production deploy
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE != "schedule"'
run one off task:
extends:
- .production
stage: post-deploy
before_script:
- *bundle
script:
- ssh_wrap cap production one_off:run
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE != "schedule"'
when: manual