---
kind: pipeline
type: docker
name: CI build

steps:
  - name: restore-cache
    image: drillster/drone-volume-cache
    volumes:
    - name: cache
      path: /cache
    settings:
      restore: true
      mount:
      - ./vendor/cache
    when:
      branch:
        - master
  - name: rspec
    image: gitea.kosmos.org/kosmos/akkounts-ci:0.9.1
    environment:
      RAILS_ENV: test
      REDIS_URL: redis://redis:6379/0
      RS_REDIS_URL: redis://redis:6379/1
    commands:
      - bundle config unset deployment
      - bundle config set cache_all 'true'
      - bundle config set cache_path 'vendor/cache'
      - bundle config set with 'development test'
      - bundle install --jobs=3 --retry=3
      - bundle exec rails db:create
      - bundle exec rails db:migrate
      - yarn install
      - rake css:build
      - bundle exec rspec
  - name: rebuild-cache
    image: drillster/drone-volume-cache
    volumes:
    - name: cache
      path: /cache
    settings:
      rebuild: true
      mount:
      - ./vendor/cache
    when:
      branch:
        - master

services:
  - name: redis
    image: redis

volumes:
  - name: cache
    host:
      path: /var/lib/drone/tmp
---
kind: signature
hmac: f9a8cf97f6596625721365f6238f6f298aa5a7a4de10c3fb61c57202ae9d1ee1

...
