-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
139 lines (128 loc) · 2.84 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
image: cyfronet/ruby-2.4.1-node-chrome
services:
- postgres
variables:
POSTGRES_DB: iee_test
POSTGRES_USER: iee
POSTGRES_PASSWORD: ""
POSTGRES_HOST_AUTH_METHOD: trust
cache:
paths:
- vendor/
stages:
- test
- deploy
test:
stage: test
script:
- google-chrome --version
- ruby -v
- gem list
- which ruby
- bundle -v
- gem install bundler --no-ri --no-rdoc
- ruby -v
- gem list
- which ruby
- bundle -v
- bundle install --path vendor --jobs $(nproc) "${FLAGS[@]}"
- ruby -v
- gem list
- which ruby
- bundle -v
- cp config/database.yml.gitlab-ci config/database.yml
- bundle exec rake db:drop RAILS_ENV=test
- bundle exec rake db:create RAILS_ENV=test
- bundle exec rake db:migrate RAILS_ENV=test
- bundle exec rspec
integration:
stage: test
script:
- google-chrome --version
- ruby -v
- gem list
- which ruby
- bundle -v
- gem install bundler --no-ri --no-rdoc
- ruby -v
- gem list
- which ruby
- bundle -v
- bundle install --path vendor --jobs $(nproc) "${FLAGS[@]}"
- cp config/database.yml.gitlab-ci config/database.yml
- bundle exec rake db:drop RAILS_ENV=test
- bundle exec rake db:create RAILS_ENV=test
- bundle exec rake db:migrate RAILS_ENV=test
- echo -e $PROD_DEV_PEM > config/jwt/dev.pem
- bundle exec rspec --tag gitlab
rubocop:
stage: test
script:
- ruby -v
- gem list
- which ruby
- bundle -v
- gem install bundler --no-ri --no-rdoc
- ruby -v
- gem list
- which ruby
- bundle -v
- bundle install --path vendor --jobs $(nproc) "${FLAGS[@]}"
- ruby -v
- gem list
- which ruby
- bundle -v
- bundle exec rubocop
brakeman:
stage: test
script:
- ruby -v
- gem list
- which ruby
- bundle -v
- gem install brakeman --no-ri --no-rdoc
- ruby -v
- gem list
- which ruby
- bundle -v
- brakeman --exit-on-warn --quiet -f plain
deploy_development:
stage: deploy
script:
- mkdir /root/.ssh
- echo $DEV_HOST_KEY > ~/.ssh/known_hosts
- echo -e $DEV_KEY > ~/.ssh/id_rsa
- chmod 400 ~/.ssh/id_rsa
- git push $DEV_GIT_REPO HEAD:master
only:
- master
environment:
name: development
url: https://process-dev.cyfronet.pl
deploy_production:
stage: deploy
script:
- mkdir /root/.ssh
- echo $PROD_HOST_KEY > ~/.ssh/known_hosts
- echo -e $PROD_KEY > ~/.ssh/id_rsa
- chmod 400 ~/.ssh/id_rsa
- git push $PROD_GIT_REPO $CI_COMMIT_TAG
only:
- tags
environment:
name: production
url: https://process.cyfronet.pl
deploy_production_manual:
stage: deploy
script:
- mkdir /root/.ssh
- echo $PROD_HOST_KEY > ~/.ssh/known_hosts
- echo -e $PROD_KEY > ~/.ssh/id_rsa
- chmod 400 ~/.ssh/id_rsa
- git push $PROD_GIT_REPO HEAD:master
when: manual
only:
- master
environment:
name: production
url: https://process.cyfronet.pl