Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: world cardinal dev using redis from docker-compose #70

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions cmd/world/cardinal/dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,8 @@

// Start Redis container
group.Go(func() error {
//nolint:gosec // not applicable
cmd := exec.Command(
"docker", "run", "-d", "-p", fmt.Sprintf("%s:%s", RedisPort, RedisPort),
"--name", "cardinal-dev-redis", "redis",
"docker", "compose", "up", "-d", "redis",
)

// Retry starting Redis container until successful
Expand Down Expand Up @@ -273,10 +271,10 @@
}

func stopRedis() error {
logger.Println("Stopping cardinal-dev-redis container")
if err := sh.Run("docker", "rm", "-f", "cardinal-dev-redis"); err != nil {
logger.Println("Stopping redis container")
if err := sh.Run("docker", "compose", "down"); err != nil {
logger.Println("Failed to delete Redis container automatically")
logger.Println("Please delete it manually with `docker rm -f cardinal-dev-redis`")
logger.Println("Please delete it manually with `docker compose down`")

Check warning on line 277 in cmd/world/cardinal/dev.go

View check run for this annotation

Codecov / codecov/patch

cmd/world/cardinal/dev.go#L277

Added line #L277 was not covered by tests
return err
}
return nil
Expand Down
Loading