From 258566822e764d4e17711d8ed805159eeb096238 Mon Sep 17 00:00:00 2001 From: maddalax Date: Sat, 21 Sep 2024 12:37:22 -0500 Subject: [PATCH] fix build command --- cli/htmgo/tasks/run/build.go | 14 ++++---------- htmgo-site/Dockerfile | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/cli/htmgo/tasks/run/build.go b/cli/htmgo/tasks/run/build.go index deaaad10..53c6d2fa 100644 --- a/cli/htmgo/tasks/run/build.go +++ b/cli/htmgo/tasks/run/build.go @@ -2,6 +2,7 @@ package run import ( "github.com/maddalax/htmgo/cli/htmgo/tasks/astgen" + "github.com/maddalax/htmgo/cli/htmgo/tasks/copyassets" "github.com/maddalax/htmgo/cli/htmgo/tasks/css" "github.com/maddalax/htmgo/cli/htmgo/tasks/process" ) @@ -9,18 +10,11 @@ import ( func Build() { astgen.GenAst(process.ExitOnError) css.GenerateCss(process.ExitOnError) - process.RunOrExit("rm -rf ./dist") - process.RunOrExit("mkdir -p ./dist") - //process.RunOrExit("mkdir -p ./dist/assets/dist") + copyassets.CopyAssets() - //dirutil.CopyDir( - // "./assets/dist", - // "./dist/assets/dist", - // func(path string, exists bool) bool { - // return true - // }, - //) + process.RunOrExit("rm -rf ./dist") + process.RunOrExit("mkdir -p ./dist") process.RunOrExit("env GOOS=linux GOARCH=amd64 go build -o ./dist/app-linux-amd64 .") process.RunOrExit("go build -o ./dist/app .") diff --git a/htmgo-site/Dockerfile b/htmgo-site/Dockerfile index f63f6985..f8a56f33 100644 --- a/htmgo-site/Dockerfile +++ b/htmgo-site/Dockerfile @@ -14,7 +14,7 @@ RUN go mod download COPY . . # Build the Go binary for Linux -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o server +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go run github.com/maddalax/htmgo/cli/htmgo@latest build # Stage 2: Create the smallest possible image FROM gcr.io/distroless/base-debian11