Commit ea731cac authored by Kamil Trzcinski's avatar Kamil Trzcinski

Preserve knapsack state

parent d8e90d03
......@@ -21,7 +21,7 @@ before_script:
- source ./scripts/prepare_build.sh
- cp config/gitlab.yml.example config/gitlab.yml
- bundle --version
- retry bundle install --without postgres production --jobs $(nproc) "${FLAGS[@]}"
- '[ "$USE_BUNDLE_INSTALL" != "true" ] || retry bundle install --without postgres production --jobs $(nproc) "${FLAGS[@]}"'
- retry gem install knapsack
- '[ "$USE_DB" != "true" ] || bundle exec rake db:drop db:create db:schema:load db:migrate'
......@@ -31,18 +31,26 @@ stages:
- post-test
- notifications
prepare:
precompile:
stage: prepare
variables:
USE_DB: "false"
script:
- bundle exec rake assets:precompile
- mkdir -p knapsack/
- echo "{}" > knapsack/rspec_report.json
- echo "{}" > knapsack/spinach_report.json
artifacts:
paths:
- public/assets/
.knapsack_state: &knapsack_state
variables:
USE_DB: "false"
USE_BUNDLE_INSTALL: "false"
cache:
key: "knapsack"
paths:
- knapsack/
artifacts:
paths:
- knapsack/
.knapsack: &knapsack
......@@ -59,21 +67,21 @@ prepare:
paths:
- knapsack/
post-tests:
knapsack:
<<: *knapsack_state
stage: prepare
script:
- mkdir -p knapsack/
- '[[ -f knapsack/rspec_report.json ]] || echo "{}" > knapsack/rspec_report.json'
- '[[ -f knapsack/spinach_report.json ]] || echo "{}" > knapsack/spinach_report.json'
update-knapsack:
<<: *knapsack_state
stage: post-test
variables:
USE_DB: "false"
script:
- scripts/merge-reports knapsack/rspec_report.json knapsack/rspec_node_*.json
- scripts/merge-reports knapsack/spinach_report.json knapsack/spinach_node_*.json
- rm -f knapsack/*_node_*.json
cache:
key: "knapsack"
paths:
- knapsack/
artifacts:
paths:
- knapsack/
.exec: &exec
stage: test
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment