check that gomod dir available before binding
Some checks failed
Deploy / CreateImage (push) Failing after 48s
Deploy / DeployService (push) Has been skipped

This commit is contained in:
skeris 2024-12-30 01:46:06 +03:00
parent 4b3ee58dd2
commit 0b94e4f5f5
2 changed files with 6 additions and 7 deletions

@ -3,10 +3,14 @@ WORKDIR /app
ENV GOPRIVATE=gitea.pena/PenaSide/common,gitea.pena/PenaSide/linters-golang,gitea.pena/PenaSide/customer,gitea.pena/PenaSide/trashlog,gitea.pena/PenaSide/hlog ENV GOPRIVATE=gitea.pena/PenaSide/common,gitea.pena/PenaSide/linters-golang,gitea.pena/PenaSide/customer,gitea.pena/PenaSide/trashlog,gitea.pena/PenaSide/hlog
ENV GOINSECURE=gitea.pena/PenaSide/common,gitea.pena/PenaSide/linters-golang,gitea.pena/PenaSide/customer,gitea.pena/PenaSide/trashlog,gitea.pena/PenaSide/hlog ENV GOINSECURE=gitea.pena/PenaSide/common,gitea.pena/PenaSide/linters-golang,gitea.pena/PenaSide/customer,gitea.pena/PenaSide/trashlog,gitea.pena/PenaSide/hlog
ENV GOPROXY=https://proxy.golang.org,direct ENV GOPROXY=https://proxy.golang.org,direct
ENV GOPATH=go-cache
COPY . . COPY . .
RUN --mount=type=bind,source=go-cache,dst=/go/pkg/mod/,rw=true go mod download RUN mkdir -p /go/pkg/mod/
RUN ls /go/pkg/mod
RUN --mount=type=bind,source=go-cache,dst=/go-cache,rw=true go mod download
RUN ls /go/pkg/mod
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o app ./cmd/verification/main.go RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o app ./cmd/verification/main.go
RUN ls /go/pkg/mod/ RUN ls /go/pkg/mod
RUN pwd RUN pwd
RUN printenv RUN printenv

@ -3,7 +3,6 @@ package config
import ( import (
"gitea.pena/PenaSide/common/mongo" "gitea.pena/PenaSide/common/mongo"
"github.com/caarlos0/env/v8" "github.com/caarlos0/env/v8"
"github.com/joho/godotenv"
) )
type Config struct { type Config struct {
@ -28,10 +27,6 @@ type External struct {
} }
func NewConfig(file ...string) (*Config, error) { func NewConfig(file ...string) (*Config, error) {
if err := godotenv.Load(file...); err != nil {
return nil, err
}
var cfg Config var cfg Config
if err := env.Parse(&cfg); err != nil { if err := env.Parse(&cfg); err != nil {
return nil, err return nil, err