Skip to content

Commit

Permalink
fix build command
Browse files Browse the repository at this point in the history
  • Loading branch information
maddalax committed Sep 21, 2024
1 parent 1a756b7 commit 2585668
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
14 changes: 4 additions & 10 deletions cli/htmgo/tasks/run/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,19 @@ 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"
)

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 .")
Expand Down
2 changes: 1 addition & 1 deletion htmgo-site/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2585668

Please sign in to comment.