-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
43 lines (37 loc) · 1019 Bytes
/
.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
image: ruby:2.3
services:
- postgres:9.4
variables:
POSTGRES_DB: housemanager_test
POSTGRES_USER: runner
RAILS_ENV: test
cache:
paths:
- vendor/bundle
before_script:
- ruby -v
- which ruby
- gem install pg
- apt-get update -qy
- apt-get install -y nodejs
- gem install bundler --no-ri --no-rdoc
- bundle check --path vendor/bundle || bundle install --path vendor/bundle --jobs $(nproc)
test:
stage: test
script:
- RAILS_ENV=test bundle exec rake db:create --trace
- RAILS_ENV=test bundle exec rake db:migrate --trace
- bundle exec rspec
deploy:
stage: deploy
only:
- master
script:
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" >> ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- gem install bundler --no-ri --no-rdoc
- bundle check --path vendor/bundle || bundle install --path vendor/bundle --jobs $(nproc)
- gem install capistrano
- bundle exec cap production deploy