diff options
| author | Xe Iaso <me@xeiaso.net> | 2023-08-11 19:51:49 -0400 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2023-08-11 19:51:49 -0400 |
| commit | bacd38d2a3a68c2ac951be0b3763bdf7caf45f23 (patch) | |
| tree | 5f8b2d9dd3e9a7cafa57ed71995308d1eae009c9 /cmd | |
| parent | 6607ca0ec6565130aaec80cc750ce5d3cde15924 (diff) | |
| download | x-bacd38d2a3a68c2ac951be0b3763bdf7caf45f23.tar.xz x-bacd38d2a3a68c2ac951be0b3763bdf7caf45f23.zip | |
replace all build.go files with yeetfiles
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/johaus/build.go | 43 | ||||
| -rw-r--r-- | cmd/johaus/yeetfile.js | 30 | ||||
| -rw-r--r-- | cmd/robocadey2/build.go | 25 | ||||
| -rwxr-xr-x | cmd/robocadey2/do_image_gen.sh | 10 | ||||
| -rw-r--r-- | cmd/xedn/build.go | 25 |
5 files changed, 30 insertions, 103 deletions
diff --git a/cmd/johaus/build.go b/cmd/johaus/build.go deleted file mode 100644 index 8f7caea..0000000 --- a/cmd/johaus/build.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build ignore -// +build ignore - -// Builds and deploys the application to minipaas. -package main - -import ( - "context" - "log" - "os" - - "within.website/x/internal" - "within.website/x/internal/kahless" - "within.website/x/internal/minipaas" - "within.website/x/internal/yeet" -) - -func main() { - internal.HandleStartup() - - 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 := "johaus-" + yeet.DateTag + ".tar.gz" - pubURL, err := kahless.CopySlug(fname, fin) - if err != nil { - log.Fatal(err) - } - - err = minipaas.Exec("tar:from johaus " + pubURL) - if err != nil { - log.Fatal(err) - } -} diff --git a/cmd/johaus/yeetfile.js b/cmd/johaus/yeetfile.js new file mode 100644 index 0000000..5a8c5ba --- /dev/null +++ b/cmd/johaus/yeetfile.js @@ -0,0 +1,30 @@ +yeet.setenv("GOOS", "linux"); +yeet.setenv("GOARCH", "amd64"); +yeet.setenv("CGO_ENABLED", "0"); + +go.build(); +const fname = slug.build("johaus"); + +const url = slug.push(fname); +const hash = nix.hashURL(url); + +const expr = nix.expr`{ stdenv }: + +stdenv.mkDerivation { + name = "johaus"; + src = builtins.fetchurl { + url = ${url}; + sha256 = ${hash}; + }; + + phases = "installPhase"; + + installPhase = '' + tar xf $src + mkdir -p $out/bin + cp bin/main $out/bin/johaus + ''; +} +`; + +file.write("/home/cadey/code/nixos-configs/pkgs/x/johaus.nix", expr); diff --git a/cmd/robocadey2/build.go b/cmd/robocadey2/build.go deleted file mode 100644 index 752f354..0000000 --- a/cmd/robocadey2/build.go +++ /dev/null @@ -1,25 +0,0 @@ -//go:build ignore - -// Builds and deploys the application to fly.io. -package main - -import ( - "context" - "os" - - "within.website/x/internal" - "within.website/x/internal/yeet" -) - -func main() { - internal.HandleStartup() - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - env := append(os.Environ(), []string{"CGO_ENABLED=0", "GOOS=linux"}...) - yeet.ShouldWork(ctx, env, yeet.WD, "nix", "build", ".#docker.robocadey2") - yeet.DockerLoadResult(ctx, "./result") - yeet.DockerPush(ctx, "registry.fly.io/xe-robocadey2:latest") - yeet.ShouldWork(ctx, env, yeet.WD, "flyctl", "deploy", "--now") -} diff --git a/cmd/robocadey2/do_image_gen.sh b/cmd/robocadey2/do_image_gen.sh deleted file mode 100755 index 18978e1..0000000 --- a/cmd/robocadey2/do_image_gen.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env nix-shell -#! nix-shell -p conda -i conda-shell - -set -euo pipefail - -cd $HOME/code/stable-diffusion -source ~/.bashrc -conda activate ldm - -python optimizedSD/robocadey.py --H 512 --W 512 --turbo --seed $SEED --from-file $OUTDIR/prompt.txt --outdir $OUTDIR diff --git a/cmd/xedn/build.go b/cmd/xedn/build.go deleted file mode 100644 index 11aea9b..0000000 --- a/cmd/xedn/build.go +++ /dev/null @@ -1,25 +0,0 @@ -//go:build ignore - -// Builds and deploys the application to fly.io. -package main - -import ( - "context" - "os" - - "within.website/x/internal" - "within.website/x/internal/yeet" -) - -func main() { - internal.HandleStartup() - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - env := append(os.Environ(), []string{"CGO_ENABLED=0", "GOOS=linux"}...) - yeet.ShouldWork(ctx, env, yeet.WD, "nix", "build", ".#docker.xedn") - yeet.DockerLoadResult(ctx, "./result") - yeet.DockerPush(ctx, "registry.fly.io/xedn:latest") - yeet.ShouldWork(ctx, env, yeet.WD, "flyctl", "deploy", "--now") -} |
