forked from salesdemocf/rails-app-with-knapsack_pro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
36 lines (28 loc) · 1.01 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
image: "ruby:2.6"
services:
- postgres
variables:
RAILS_ENV: test
PGHOST: 127.0.0.1
KNAPSACK_PRO_REPO_PATH: ~/gems/knapsack_pro-ruby
KNAPSACK_PRO_GIT_REPO: https://github.com/KnapsackPro/knapsack_pro-ruby.git
KNAPSACK_PRO_ENDPOINT: https://api-staging.knapsackpro.com
# KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: it is set in Settings -> CI/CD -> Variables (Expand) as masked variable
before_script:
- apt-get update -qq && apt-get install -y -qq nodejs
- ruby -v
- which ruby
# clone knapsack_pro gem repo
- mkdir ~/gems
- cd ~/gems && (git clone -b $CI_COMMIT_REF_NAME --single-branch $KNAPSACK_PRO_GIT_REPO || git clone -b master --single-branch $KNAPSACK_PRO_GIT_REPO)
- cd ~/gems/knapsack_pro-ruby && git branch
- cd ~/gems/knapsack_pro-ruby && git log -n 1 | more
- cd $CI_PROJECT_DIR
- gem install bundler --no-document
- bundle install --jobs $(nproc) "${FLAGS[@]}"
# Database setup
- bin/rails db:setup
rspec:
parallel: 2
script:
- bundle exec rake knapsack_pro:queue:rspec