diff options
| author | Christine Dodrill <me@christine.website> | 2019-04-01 10:05:03 -0700 |
|---|---|---|
| committer | Christine Dodrill <me@christine.website> | 2019-04-01 10:05:28 -0700 |
| commit | f06f021f402270951f849dde7bee3f3340b8a1d5 (patch) | |
| tree | baee337aab524f162b349d254d21c2d8f2716d44 /cmd/within.website/build.go | |
| parent | ba91a17859267201b1d1f0e71da465b1464d940f (diff) | |
| download | x-f06f021f402270951f849dde7bee3f3340b8a1d5.tar.xz x-f06f021f402270951f849dde7bee3f3340b8a1d5.zip | |
reorg
Diffstat (limited to 'cmd/within.website/build.go')
| -rw-r--r-- | cmd/within.website/build.go | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/cmd/within.website/build.go b/cmd/within.website/build.go new file mode 100644 index 0000000..d72d9f5 --- /dev/null +++ b/cmd/within.website/build.go @@ -0,0 +1,39 @@ +//+build ignore + +// Builds and deploys the application to minipaas. +package main + +import ( + "context" + "log" + "os" + + "github.com/Xe/x/internal/greedo" + "github.com/Xe/x/internal/minipaas" + "github.com/Xe/x/internal/yeet" +) + +func main() { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + 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 := greedo.CopyFile(fname, fin) + if err != nil { + log.Fatal(err) + } + + err = minipaas.Exec("tar:from within.website " + pubURL) + if err != nil { + log.Fatal(err) + } +} |
