Commit ea731cac authored by Kamil Trzcinski's avatar Kamil Trzcinski

Preserve knapsack state

parent d8e90d03
...@@ -21,7 +21,7 @@ before_script: ...@@ -21,7 +21,7 @@ before_script:
- source ./scripts/prepare_build.sh - source ./scripts/prepare_build.sh
- cp config/gitlab.yml.example config/gitlab.yml - cp config/gitlab.yml.example config/gitlab.yml
- bundle --version - 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 - retry gem install knapsack
- '[ "$USE_DB" != "true" ] || bundle exec rake db:drop db:create db:schema:load db:migrate' - '[ "$USE_DB" != "true" ] || bundle exec rake db:drop db:create db:schema:load db:migrate'
...@@ -31,18 +31,26 @@ stages: ...@@ -31,18 +31,26 @@ stages:
- post-test - post-test
- notifications - notifications
prepare: precompile:
stage: prepare stage: prepare
variables: variables:
USE_DB: "false" USE_DB: "false"
script: script:
- bundle exec rake assets:precompile - bundle exec rake assets:precompile
- mkdir -p knapsack/
- echo "{}" > knapsack/rspec_report.json
- echo "{}" > knapsack/spinach_report.json
artifacts: artifacts:
paths: paths:
- public/assets/ - public/assets/
.knapsack_state: &knapsack_state
variables:
USE_DB: "false"
USE_BUNDLE_INSTALL: "false"
cache:
key: "knapsack"
paths:
- knapsack/
artifacts:
paths:
- knapsack/ - knapsack/
.knapsack: &knapsack .knapsack: &knapsack
...@@ -59,21 +67,21 @@ prepare: ...@@ -59,21 +67,21 @@ prepare:
paths: paths:
- knapsack/ - 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 stage: post-test
variables:
USE_DB: "false"
script: script:
- scripts/merge-reports knapsack/rspec_report.json knapsack/rspec_node_*.json - scripts/merge-reports knapsack/rspec_report.json knapsack/rspec_node_*.json
- scripts/merge-reports knapsack/spinach_report.json knapsack/spinach_node_*.json - scripts/merge-reports knapsack/spinach_report.json knapsack/spinach_node_*.json
- rm -f knapsack/*_node_*.json - rm -f knapsack/*_node_*.json
cache:
key: "knapsack"
paths:
- knapsack/
artifacts:
paths:
- knapsack/
.exec: &exec .exec: &exec
stage: test 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