Skip to content

Commit

Permalink
Added getDump and seed options for redis
Browse files Browse the repository at this point in the history
  • Loading branch information
Andriiklymiuk committed Sep 8, 2023
1 parent 1659d37 commit 1717689
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/spf13/cobra"
)

var APP_VERSION = "1.1.84"
var APP_VERSION = "1.1.85"

// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Expand Down
14 changes: 12 additions & 2 deletions templates/redisTemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,27 @@ networks:
var MakefileRedis = `up:
docker compose up -d
down:
docker compose down
docker compose down
stop:
docker stop redis-{{.ServiceName}}
id:
docker ps -aqf "name=redis-{{.ServiceName}}" | awk '{print $1}'
seed:
@echo "Copying dump.rdb into local Docker container..."
docker cp ./dump.rdb redis-{{.ServiceName}}:/data/
@echo "Restarting Redis service in Docker container..."
docker restart redis-{{.ServiceName}}
getDump:
@echo "Creating Redis dump..."
docker exec redis-{{.ServiceName}} redis-cli SAVE
@echo "Copying dump.rdb to current directory..."
docker cp redis-{{.ServiceName}}:/data/dump.rdb ./dump.rdb
remove:
docker rm redis-{{.ServiceName}}
help:
make -qpRr | egrep -e '^[a-z].*:$$' | sed -e 's~:~~g' | sort
.PHONY: up down stop id remove help
.PHONY: up down stop id remove getDump seed help
`
var RedisConfiguration = `aclfile /etc/redis/users.acl`

Expand Down

0 comments on commit 1717689

Please sign in to comment.