diff --git a/.drone.yml b/.drone.yml index d90244b..303b906 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,7 +7,7 @@ steps: image: golang:latest commands: - go install honnef.co/go/tools/cmd/staticcheck@latest - - staticcheck ./src/internal/... + - cd src && staticcheck ./... volumes: - name: gopath path: /go @@ -16,7 +16,7 @@ steps: image: golang:latest commands: - go install golang.org/x/lint/golint@latest - - golint ./src/internal/... + - golint ./src/... volumes: - name: gopath path: /go @@ -24,7 +24,7 @@ steps: - name: analyze image: golang:latest commands: - - go vet ./src/internal/... + - cd src && go vet ./... volumes: - name: gopath path: /go diff --git a/Dockerfile b/Dockerfile index e2d0d45..7035cbe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,7 @@ RUN go mod download && \ FROM gcr.io/distroless/base-debian10 LABEL author="Piotr Biernat" +LABEL service="identity" LABEL vendor="Egommerce" LABEL version="1.0" diff --git a/src/cmd/main.go b/src/cmd/main.go index 32519dc..9e19c20 100644 --- a/src/cmd/main.go +++ b/src/cmd/main.go @@ -14,9 +14,9 @@ import ( ) const ( - defHttpIp = "0.0.0.0" - defHttpPort = "8080" - defDbUrl = "postgres://postgres:12345678@postgres_svc:5432/egommerce" + defHTTPIP = "0.0.0.0" + defHTTPPort = "8080" + defDbURL = "postgres://postgres:12345678@postgres_svc:5432/egommerce" ) func main() { @@ -24,15 +24,15 @@ func main() { app.Panicf("Error loading .env file") } - httpAddr := net.JoinHostPort(config.GetEnv("SERVER_IP", defHttpIp), defHttpPort) - dbConnStr := config.GetEnv("DATABASE_URL", defDbUrl) + httpAddr := net.JoinHostPort(config.GetEnv("SERVER_IP", defHTTPIP), defHTTPPort) + dbConnStr := config.GetEnv("DATABASE_URL", defDbURL) dbc, err := database.Connect(dbConnStr) if err != nil { app.Panicf("Unable to connect to database: %v\n", err) } - env := &handler.Env{httpAddr, dbc} + env := &handler.Env{Addr: httpAddr, DB: dbc} srv := app.NewServer(env) go srv.Start()