-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
69 lines (61 loc) · 1.87 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
image: "ruby:2.6.2"
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- vendor/ruby
- node_mo dules/
- $HOME/.yarn-cache
variables:
RAILS_ENV: test
POSTGRES_DB: test_db
POSTGRES_USER: runner
POSTGRES_PASSWORD: ""
REDISTOGO_URL: redis://redis:6379
REDISCLOUD_URL: redis://redis:6379
before_script:
# - apt-get update -yq
# - apt-get install -y postgresql postgresql-contrib libpq-dev apt-transport-https build-essential cmake wget nodejs unzip node-gyp
# - apt-get update -qq && apt-get install -y -qq postgresql postgresql-contrib libpq-dev cmake nodejs libpq-dev
# - ruby -v
# - which ruby
# - gem install bundler
# - RAILS_ENV=test bundle install --jobs $(nproc) "${FLAGS[@]}"
# - cp config/database.yml.gitlab config/database.yml
# - curl -o- -L https://yarnpkg.com/install.sh | bash
# - export PATH=$HOME/.yarn/bin:$PATH
# - source ~/.bashrc
# - yarn
# - RAILS_ENV=test bundle exec rake db:create db:schema:load
- gem install bundler
- bundle install --no-deployment --path vendor
- curl -sL https://deb.nodesource.com/setup_8.x | bash
- apt-get update -qq && apt-get install -yqq nodejs libpq-dev
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH
- source ~/.bashrc
- yarn
- cp config/database.yml.gitlab config/database.yml
- bundle exec rake db:create db:schema:load
stages:
- test
test:
stage: test
services:
- redis:latest
- postgres:latest
script:
- bundle exec rails spec
# staging:
# stage: deploy
# script:
# - gem install dpl
# - dpl --provider=heroku --app=gitlab-ci-ruby-test-staging --api-key=$HEROKU_STAGING_API_KEY
# only:
# - master
# production:
# stage: deploy
# script:
# - gem install dpl
# - dpl --provider=heroku --app=gitlab-ci-ruby-test-prod --api-key=$HEROKU_PRODUCTION_API_KEY
# only:
# - tags