Skip to content

Commit 5f2fbdf

Browse files
authored
Merge pull request #189 from LAA-Software-Engineering/fix/137-makefile-pin-run-local
chore(makefile): pin swag; run-local secrets from .env (#137)
2 parents 2016def + 0df8574 commit 5f2fbdf

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@ on:
1111
paths-ignore:
1212
- "**/*.md"
1313
- "CODEOWNERS"
14-
- "Makefile"
1514
pull_request:
1615
branches: [ "main" ]
1716
paths-ignore:
1817
- "**/*.md"
1918
- "CODEOWNERS"
20-
- "Makefile"
2119

2220
jobs:
2321
mod-tidy:

Makefile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1+
# Pin swag to the same version as Dockerfile (github.com/swaggo/swag/cmd/swag@v1.16.4).
12
setup:
2-
go get -u github.com/swaggo/swag/cmd/swag
3-
go install github.com/swaggo/swag/cmd/swag@latest
3+
go install github.com/swaggo/swag/cmd/swag@v1.16.4
44
swag init -g ./cmd/server/main.go -o ./docs
5-
go get -u github.com/swaggo/gin-swagger
6-
go get -u github.com/swaggo/files
75

86
build-docker:
97
docker compose build --no-cache
108

11-
# Run API against local Docker DBs. Requires `.env` with JWT_SECRET_KEY and API_SECRET_KEY (see .env.example).
9+
# Run API against local Docker DBs. Requires `.env` for secrets and DB settings (see .env.example).
10+
# Only overrides service hostnames to localhost for containers started outside Compose.
1211
# Optional: set GIN_MODE=release in `.env` for the same security middleware as Docker Compose.
1312
run-local:
1413
docker start dockerPostgres
@@ -17,8 +16,7 @@ run-local:
1716
test -f .env || { echo >&2 "Missing .env — copy .env.example to .env and set secrets (>=32 bytes each)."; exit 1; }
1817
set -euo pipefail; \
1918
set -a && . ./.env && set +a; \
20-
export REDIS_HOST=localhost POSTGRES_HOST=localhost \
21-
POSTGRES_DB=go_app_dev POSTGRES_USER=docker POSTGRES_PASSWORD=password POSTGRES_PORT=5435; \
19+
export REDIS_HOST=localhost POSTGRES_HOST=localhost; \
2220
go run cmd/server/main.go
2321

2422
up:

0 commit comments

Comments
 (0)