From 2a21e0b6d703d213e2e2ec4e4cc83bc1158d543c Mon Sep 17 00:00:00 2001 From: Laba Subagia Date: Tue, 30 Jan 2024 13:31:34 +0000 Subject: [PATCH] chore: update env local & docker --- .devcontainer/devcontainer.json | 2 +- .env.docker.test.example | 9 +++++++++ .env.test.example | 4 ++-- .github/workflows/test.yaml | 4 +++- 4 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 .env.docker.test.example diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 012a236..4e22912 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,7 +6,7 @@ "shutdownAction": "stopCompose", "forwardPorts": [5000], "remoteUser": "vscode", - "initializeCommand": ["cp .env.docker .env", "cp .env.test.example .env.test"], + "initializeCommand": ["cp .env.docker .env", "cp .env.docker.test.example .env.test"], "customizations": { "vscode": { "extensions": [ diff --git a/.env.docker.test.example b/.env.docker.test.example new file mode 100644 index 0000000..a582cac --- /dev/null +++ b/.env.docker.test.example @@ -0,0 +1,9 @@ +ENVIRONMENT=development +POSTGRES_SOURCE=postgres://postgres:postgres@postgres:5432/realworld?sslmode=disable +POSTGRES_MIGRATION_URL=file://../../../internal/adapter/repository/sql/db/migration +MONGO_SOURCE=mongodb://root:root@mongo:27017/realworld?authSource=admin +LOG_TYPE=zerolog +DB_TYPE=postgres +SERVER_TYPE=restful +SERVER_PORT=5000 +TOKEN_SYMMETRIC_KEY=12345678901234567890123456789012 \ No newline at end of file diff --git a/.env.test.example b/.env.test.example index a582cac..0579940 100644 --- a/.env.test.example +++ b/.env.test.example @@ -1,7 +1,7 @@ ENVIRONMENT=development -POSTGRES_SOURCE=postgres://postgres:postgres@postgres:5432/realworld?sslmode=disable +POSTGRES_SOURCE=postgres://postgres:postgres@0.0.0.0:5432/realworld?sslmode=disable POSTGRES_MIGRATION_URL=file://../../../internal/adapter/repository/sql/db/migration -MONGO_SOURCE=mongodb://root:root@mongo:27017/realworld?authSource=admin +MONGO_SOURCE=mongodb://root:root@0.0.0.0:27017/realworld?authSource=admin LOG_TYPE=zerolog DB_TYPE=postgres SERVER_TYPE=restful diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 950f1d3..81645a7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -43,4 +43,6 @@ jobs: run: go mod tidy - name: Test - run: make test_all \ No newline at end of file + run: | + cp .env.test.example .env.test + make test_all \ No newline at end of file