Skip to content

Commit

Permalink
world cardinal dev using redis from docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
zulkhair committed Jun 21, 2024
1 parent a4b9120 commit 24a5a89
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cmd/world/cardinal/dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ func startRedis(ctx context.Context) error {
group.Go(func() error {
//nolint:gosec // not applicable

Check failure on line 214 in cmd/world/cardinal/dev.go

View workflow job for this annotation

GitHub Actions / Go

directive `//nolint:gosec // not applicable` is unused for linter "gosec" (nolintlint)
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 +272,10 @@ func startRedis(ctx context.Context) error {
}

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 278 in cmd/world/cardinal/dev.go

View check run for this annotation

Codecov / codecov/patch

cmd/world/cardinal/dev.go#L278

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

0 comments on commit 24a5a89

Please sign in to comment.