diff options
Diffstat (limited to 'cmd/within.website')
| -rw-r--r-- | cmd/within.website/build.go | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/cmd/within.website/build.go b/cmd/within.website/build.go deleted file mode 100644 index b6dfb4e..0000000 --- a/cmd/within.website/build.go +++ /dev/null @@ -1,58 +0,0 @@ -//+build ignore - -// Builds and deploys the application to minipaas. -package main - -import ( - "context" - "flag" - "log" - "net/http" - "os" - - "github.com/shurcooL/vfsgen" - "within.website/x/internal" - "within.website/x/internal/kahless" - "within.website/x/internal/yeet" -) - -var ( - genVFS = flag.Bool("gen-vfs", true, "if true, generate VFS") - deploy = flag.Bool("deploy", true, "if true, deploy to minipaas via kahless") -) - -func main() { - internal.HandleStartup() - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - if *genVFS { - err := vfsgen.Generate(http.Dir("./static"), vfsgen.Options{ - PackageName: "main", - BuildTags: "!dev", - VariableName: "assets", - }) - if err != nil { - log.Fatalln(err) - } - } - - if *deploy { - env := append(os.Environ(), []string{"CGO_ENABLED=0", "GOOS=linux"}...) - yeet.ShouldWork(ctx, env, yeet.WD, "go", "build", "-o=web") - yeet.ShouldWork(ctx, env, yeet.WD, "appsluggr", "-web=web") - fin, err := os.Open("slug.tar.gz") - if err != nil { - log.Fatal(err) - } - defer fin.Close() - - fname := "within.website-" + yeet.DateTag + ".tar.gz" - pubURL, err := kahless.CopyFile(fname, fin) - if err != nil { - log.Fatal(err) - } - - log.Println(pubURL) - } -} |
