Skip to content

Commit

Permalink
Merge pull request #296 from maxekman/fix/gcp-emulator-images
Browse files Browse the repository at this point in the history
Fix / GCP emulator and MongoDB images
  • Loading branch information
maxekman authored Feb 4, 2021
2 parents f3c0cdd + 5619189 commit 698de42
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ upload_cover:

.PHONY: run
run:
docker-compose up -d mongo gpubsub kafka
docker-compose up -d mongodb gpubsub kafka
sleep 15

.PHONY: run_mongodb
run_mongodb:
docker-compose up -d mongo
docker-compose up -d mongodb

.PHONY: run_gpubsub
run_gpubsub:
Expand All @@ -66,6 +66,6 @@ clean:
@find . -name \.coverprofile -type f -delete
@rm -f gover.coverprofile

.PHONY: mongo_shell
mongo_shell:
docker run -it --network eventhorizon_default --rm mongo:4.2 mongo --host mongo test
.PHONY: mongodb_shell
mongodb_shell:
docker run -it --network eventhorizon_default --rm mongo:4.4 mongo --host mongodb test
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ services:
golang:
image: golang:1.15
environment:
MONGO_HOST: "mongo:27017"
MONGODB_HOST: "mongodb:27017"
PUBSUB_EMULATOR_HOST: "gpubsub:8793"
volumes:
- .:/eventhorizon
working_dir: /eventhorizon

mongo:
image: mongo:4.2
mongodb:
image: mongo:4.4
ports:
- "27017:27017"

gpubsub:
image: google/cloud-sdk:318.0.0
image: gcr.io/google.com/cloudsdktool/cloud-sdk:326.0.0-emulators
ports:
- "8793:8793"
entrypoint:
Expand Down
2 changes: 1 addition & 1 deletion eventstore/mongodb/eventstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestEventStoreIntegration(t *testing.T) {
}

// Use MongoDB in Docker with fallback to localhost.
url := os.Getenv("MONGO_HOST")
url := os.Getenv("MONGODB_HOST")
if url == "" {
url = "localhost:27017"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/guestlist/mongodb/mongodb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func ExampleIntegration() {
}

// Use MongoDB in Docker with fallback to localhost.
url := os.Getenv("MONGO_HOST")
url := os.Getenv("MONGODB_HOST")
if url == "" {
url = "localhost:27017"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/todomvc/backend/handler/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ func NewIntegrationTestSession(ctx context.Context) (
eh.ReadWriteRepo,
) {
// Use MongoDB in Docker with fallback to localhost.
dbURL := os.Getenv("MONGO_HOST")
dbURL := os.Getenv("MONGODB_HOST")
if dbURL == "" {
dbURL = "localhost:27017"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/todomvc/backend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func main() {
log.Println("starting TodoMVC backend")

// Use MongoDB in Docker with fallback to localhost.
dbURL := os.Getenv("MONGO_HOST")
dbURL := os.Getenv("MONGODB_HOST")
if dbURL == "" {
dbURL = "localhost:27017"
}
Expand Down
6 changes: 3 additions & 3 deletions examples/todomvc/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ services:
ports:
- "8080:8080"
environment:
MONGO_HOST: "mongo:27017"
MONGODB_HOST: "mongodb:27017"
PUBSUB_EMULATOR_HOST: "gpubsub:8793"
TRACING_URL: "tracing"

mongo:
image: mongo:4.2
mongodb:
image: mongo:4.4
ports:
- "27017:27017"

Expand Down
4 changes: 2 additions & 2 deletions repo/mongodb/repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestReadRepoIntegration(t *testing.T) {
}

// Local Mongo testing with Docker
url := os.Getenv("MONGO_HOST")
url := os.Getenv("MONGODB_HOST")

if url == "" {
// Default to localhost
Expand Down Expand Up @@ -180,7 +180,7 @@ func TestRepository(t *testing.T) {
}

// Local Mongo testing with Docker
url := os.Getenv("MONGO_HOST")
url := os.Getenv("MONGODB_HOST")
if url == "" {
// Default to localhost
url = "localhost:27017"
Expand Down

0 comments on commit 698de42

Please sign in to comment.