53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
image: "dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.3-git-2.7-phantomjs-2.1"
|
|
|
|
cache:
|
|
key: "ruby-231"
|
|
paths:
|
|
- vendor/ruby
|
|
|
|
variables:
|
|
MYSQL_ALLOW_EMPTY_PASSWORD: "1"
|
|
# retry tests only in CI environment
|
|
RSPEC_RETRY_RETRY_COUNT: "3"
|
|
RAILS_ENV: "test"
|
|
SIMPLECOV: "true"
|
|
SETUP_DB: "true"
|
|
USE_BUNDLE_INSTALL: "true"
|
|
GIT_DEPTH: "20"
|
|
PHANTOMJS_VERSION: "2.1.1"
|
|
|
|
before_script:
|
|
- source ./scripts/prepare_build.sh
|
|
- cp config/gitlab.yml.example config/gitlab.yml
|
|
- bundle --version
|
|
- '[ "$USE_BUNDLE_INSTALL" != "true" ] || retry bundle install --without postgres production --jobs $(nproc) "${FLAGS[@]}"'
|
|
- retry gem install knapsack
|
|
- '[ "$SETUP_DB" != "true" ] || bundle exec rake db:drop db:create db:schema:load db:migrate add_limits_mysql'
|
|
|
|
stages:
|
|
- prepare
|
|
- test
|
|
- post-test
|
|
- pages
|
|
|
|
.use-db: &use-db
|
|
services:
|
|
- mysql:latest
|
|
- redis:alpine
|
|
|
|
migration paths:
|
|
stage: test
|
|
<<: *use-db
|
|
variables:
|
|
SETUP_DB: "false"
|
|
script:
|
|
- git fetch origin v8.5.9
|
|
- git checkout -f FETCH_HEAD
|
|
- cp config/resque.yml.example config/resque.yml
|
|
- sed -i 's/localhost/redis/g' config/resque.yml
|
|
- bundle install --without postgres production --jobs $(nproc) ${FLAGS[@]} --retry=3
|
|
- rake db:drop db:create db:schema:load db:seed_fu
|
|
- git checkout $CI_BUILD_REF
|
|
- source scripts/prepare_build.sh
|
|
- rake db:migrate
|