Skip to content

recipes/redis

View source on GitHub

typescript
import '@catapultjs/deploy/recipes/redis'

Tasks

TaskInsertedDescription
redis:db:flushFlushes the configured Redis database or databases
redis:db:flush_allRuns redis-cli FLUSHALL

Configuration

KeyTypeDefaultDescription
redis_dbnumber | number[]1Redis DB index used by redis:db:flush. Pass an array to flush multiple DBs

Use a single Redis DB:

typescript
import { defineConfig, set } from '@catapultjs/deploy'
import '@catapultjs/deploy/recipes/redis'

set('redis_db', 1)

export default defineConfig({
  hosts: [
    {
      name: 'production',
      ssh: 'deploy@example.com',
      deployPath: '/home/deploy/myapp',
    },
  ],
})

Flush multiple Redis DBs with the same task:

typescript
set('redis_db', [0, 1, 2])

Run the tasks manually from the terminal:

bash
npx cata task redis:db:flush
npx cata task redis:db:flush_all --host staging