language: ruby

import:
  - travis-ci/build-configs:db-setup.yml

rvm: 2.6.5

script: "bundle exec rake knapsack:rspec"

addons:
  - snaps:
    - name: docker
      channel: latest/beta

env:
  global:
    - PATH=/snap/bin:$PATH
    - RUBY_GC_MALLOC_LIMIT=90000000
    - RUBY_GC_HEAP_FREE_SLOTS=200000
    - CI_NODE_TOTAL=3

  matrix:
    - CI_NODE_INDEX=0
    - CI_NODE_INDEX=1
    - CI_NODE_INDEX=2

cache: bundler

services:
  - redis-server

before_install:
  - 'gem update --system'

jobs:
  include:
    - stage: ":ship: it to Quay.io"
      install: echo skip
      before_script: echo skip
      script: make ship
      if: commit_message =~ /ship:docker/ OR env(SHIP_DOCKER) = true

deploy:
  - provider: script
    script: make ship
    on:
      branch: master
      condition: CI_NODE_INDEX=0

language: ruby

import:
  - travis-ci/build-configs:db-setup.yml

rvm: 2.6.5

script: "bundle exec rake knapsack:rspec"

addons:
  - snaps:
    - name: docker
      channel: latest/beta

env:
  global:
    - PATH=/snap/bin:$PATH
    - RUBY_GC_MALLOC_LIMIT=90000000
    - RUBY_GC_HEAP_FREE_SLOTS=200000
    - CI_NODE_TOTAL=3

  matrix:
    - CI_NODE_INDEX=0
    - CI_NODE_INDEX=1
    - CI_NODE_INDEX=2

cache: bundler

services:
  - redis-server

before_install:
  - 'gem update --system'

jobs:
  include:
    - stage: ":ship: it to Quay.io"
      install: echo skip
      before_script: echo skip
      script: make ship
      if: commit_message =~ /ship:docker/ OR env(SHIP_DOCKER) = true or branch = master

Remove deployment based on `CI_NODE_INDEX=0`
Remove deployment based on `CI_NODE_INDEX=0`

Instead of relying on unreliable `CI_NODE_INDEX=0` to decide whether
or not to deploy to Docker Hub, we make use of the existing shipping
logic by simply adding the `branch` condition to the :ship: stage.
