From 1bc9e9a7ca99ae13e2c344f6ddc7d402db31fc46 Mon Sep 17 00:00:00 2001 From: Kelvin Clement Mwinuka Date: Tue, 9 Jul 2024 17:42:01 +0800 Subject: [PATCH] Moved main.go to cmd/main.go --- .github/workflows/go.yml | 2 +- .goreleaser.yaml | 4 ++-- Dockerfile.dev | 2 +- Dockerfile.prod | 2 +- main.go => cmd/main.go | 0 5 files changed, 5 insertions(+), 5 deletions(-) rename main.go => cmd/main.go (100%) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 349f3a9e..cf5f93de 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -27,7 +27,7 @@ jobs: go-version: '1.21.4' - name: Build - run: go build -v -o bin/echovault . + run: go build -v -o bin/echovault ./cmd/... - name: Test run: make test diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 0a283b2a..a47eed6e 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,4 +1,4 @@ -version: 1 +version: 2 before: hooks: @@ -6,7 +6,7 @@ before: - go generate ./... builds: - - main: . + - main: ./cmd env: - CGO_ENABLED=0 goos: diff --git a/Dockerfile.dev b/Dockerfile.dev index 1181cce9..737d3982 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -12,7 +12,7 @@ RUN CGO_ENABLED=$CGO_ENABLED CC=$CC GOOS=$GOOS GOARCH=$GOARCH go build -buildmo RUN CGO_ENABLED=$CGO_ENABLED CC=$CC GOOS=$GOOS GOARCH=$GOARCH go build -buildmode=plugin -o $DEST/module_get/module_get.so ./internal/volumes/modules/module_get/module_get.go ENV DEST=bin -RUN CGO_ENABLED=$CGO_ENABLED CC=$CC GOOS=$GOOS GOARCH=$GOARCH go build -o $DEST/server . +RUN CGO_ENABLED=$CGO_ENABLED CC=$CC GOOS=$GOOS GOARCH=$GOARCH go build -o $DEST/server ./cmd/... diff --git a/Dockerfile.prod b/Dockerfile.prod index 1a7db699..5be47288 100644 --- a/Dockerfile.prod +++ b/Dockerfile.prod @@ -2,7 +2,7 @@ FROM --platform=linux/amd64 golang:alpine AS build RUN apk add --no-cache gcc musl-dev WORKDIR /build COPY . ./ -RUN CGO_ENABLED=1 CC=gcc GOOS=linux GOARCH=amd64 go build -o bin/server . +RUN CGO_ENABLED=1 CC=gcc GOOS=linux GOARCH=amd64 go build -o bin/server ./cmd/... FROM --platform=linux/amd64 alpine:latest AS server RUN mkdir -p /usr/echovault/bin diff --git a/main.go b/cmd/main.go similarity index 100% rename from main.go rename to cmd/main.go