mirror of
https://github.com/onsonr/sonr.git
synced 2025-03-10 21:09:11 +00:00
refactor: Deployment setup
This commit is contained in:
parent
b9b868d55a
commit
e89bbb05b1
2
.gitignore
vendored
2
.gitignore
vendored
@ -11,6 +11,8 @@
|
|||||||
aof*
|
aof*
|
||||||
dist
|
dist
|
||||||
**/.haptic
|
**/.haptic
|
||||||
|
static
|
||||||
|
pkg/webapp/dist
|
||||||
|
|
||||||
# Test binary
|
# Test binary
|
||||||
*.test
|
*.test
|
||||||
|
41
Makefile
41
Makefile
@ -262,6 +262,9 @@ ictest-tokenfactory:
|
|||||||
### testnet ###
|
### testnet ###
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
setup-ipfs:
|
||||||
|
./scripts/ipfs_config.sh
|
||||||
|
|
||||||
setup-testnet: mod-tidy is-localic-installed install local-image set-testnet-configs setup-testnet-keys
|
setup-testnet: mod-tidy is-localic-installed install local-image set-testnet-configs setup-testnet-keys
|
||||||
|
|
||||||
# Run this before testnet keys are added
|
# Run this before testnet keys are added
|
||||||
@ -291,25 +294,19 @@ sh-testnet: mod-tidy
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
### generation ###
|
### generation ###
|
||||||
###############################################################################
|
###############################################################################
|
||||||
.PHONY: buf-deploy pkl-gen tailwind-gen templ-gen
|
.PHONY: pkl-gen styles-gen templ-gen
|
||||||
|
|
||||||
buf-deploy:
|
|
||||||
cd ./proto && bunx buf dep update && bunx buf build && bunx buf push
|
|
||||||
|
|
||||||
pkl-deploy:
|
|
||||||
sh ./scripts/upload_pkl.sh
|
|
||||||
|
|
||||||
pkl-gen:
|
pkl-gen:
|
||||||
|
go install github.com/apple/pkl-go/cmd/pkl-gen-go@latest
|
||||||
pkl-gen-go pkl/base.types/Ctx.pkl
|
pkl-gen-go pkl/base.types/Ctx.pkl
|
||||||
pkl-gen-go pkl/base.types/DWN.pkl
|
pkl-gen-go pkl/base.types/DWN.pkl
|
||||||
pkl-gen-go pkl/base.types/ORM.pkl
|
pkl-gen-go pkl/base.types/ORM.pkl
|
||||||
|
|
||||||
tailwind-gen:
|
styles-gen:
|
||||||
cd ./pkg/webapp && bun install && bun run build
|
sh ./scripts/tailwindgen.sh
|
||||||
cp ./pkg/webapp/components/styles/styles.css ./cmd/hway/styles.css
|
|
||||||
rm -rf ./pkg/webapp/node_modules
|
|
||||||
|
|
||||||
templ-gen:
|
templ-gen:
|
||||||
|
@go install github.com/a-h/templ/cmd/templ@latest
|
||||||
templ generate
|
templ generate
|
||||||
|
|
||||||
|
|
||||||
@ -318,15 +315,23 @@ templ-gen:
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
.PHONY: motr-build hway-build hway-serve
|
.PHONY: motr-build hway-build hway-serve
|
||||||
|
|
||||||
buf-deploy:
|
motr-build:
|
||||||
|
GOOS=js GOARCH=wasm go build -o static/wasm/app.wasm ./cmd/motr/main.go
|
||||||
|
|
||||||
|
hway-build: styles-gen templ-gen
|
||||||
|
go build -o build/hway ./cmd/hway/main.go
|
||||||
|
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
### help ###
|
||||||
|
###############################################################################
|
||||||
|
.PHONY: deploy-buf deploy-cdn
|
||||||
|
|
||||||
|
deploy-buf:
|
||||||
cd ./proto && bunx buf dep update && bunx buf build && bunx buf push
|
cd ./proto && bunx buf dep update && bunx buf build && bunx buf push
|
||||||
|
|
||||||
|
deploy-cdn:
|
||||||
motr-build:
|
sh ./scripts/upload_cdn.sh
|
||||||
GOOS=js GOARCH=wasm go build -o build/app.wasm ./cmd/motr/main.go
|
|
||||||
|
|
||||||
hway-build: tailwind-gen templ-gen
|
|
||||||
go build -o build/hway ./cmd/hway/main.go
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
@ -26,9 +26,9 @@
|
|||||||
"init_hook": ["export ROOT=$(git rev-parse --show-toplevel)"],
|
"init_hook": ["export ROOT=$(git rev-parse --show-toplevel)"],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"devnet": ["cd $ROOT", "make sh-testnet"],
|
"devnet": ["cd $ROOT", "make sh-testnet"],
|
||||||
"ipfs": ["ipfs daemon"],
|
"ipfs": ["cd $ROOT", "make setup-ipfs", "ipfs daemon"],
|
||||||
"air": ["cd $ROOT", "air"],
|
"air": ["cd $ROOT", "air"],
|
||||||
"gex": ["gex"]
|
"gex": ["go install github.com/cosmos/gex@latest", "gex"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
29
devbox.json
29
devbox.json
@ -1,32 +1,23 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.12.0/.schema/devbox.schema.json",
|
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.12.0/.schema/devbox.schema.json",
|
||||||
"packages": [
|
"packages": ["go@1.22", "bun@latest", "gum@latest"],
|
||||||
"go@1.22",
|
|
||||||
"bun@latest",
|
|
||||||
"ipfs@latest",
|
|
||||||
"templ@latest",
|
|
||||||
"gum@latest"
|
|
||||||
],
|
|
||||||
"env": {
|
"env": {
|
||||||
"GOPATH": "$HOME/go",
|
"GOPATH": "$HOME/go",
|
||||||
"PATH": "./build:$HOME/go/bin:$PATH",
|
"PATH": "./build:$HOME/go/bin:$PATH",
|
||||||
"TEMPL_EXPERIMENT": "rawgo"
|
"TEMPL_EXPERIMENT": "rawgo"
|
||||||
},
|
},
|
||||||
"shell": {
|
"shell": {
|
||||||
"init_hook": [
|
|
||||||
"./scripts/init_env.sh"
|
|
||||||
],
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start-local": [
|
"deploy-buf": ["gum spin --title='Deploying buf' -- make deploy-buf"],
|
||||||
"cd deploy/local && devbox services up"
|
"deploy-cdn": [
|
||||||
|
"gum spin --title='Generating PKL' -- make pkl-gen",
|
||||||
|
"gum spin --title='Generating Styles' -- make styles-gen",
|
||||||
|
"gum spin --title='Building Motr WASM' -- make motr-build",
|
||||||
|
"gum spin --title='Uploading to Bucket' -- make deploy-cdn"
|
||||||
],
|
],
|
||||||
"start-testnet": [
|
"start-local": ["cd deploy/local && devbox services up"],
|
||||||
"cd deploy/testnet && devbox services up"
|
"start-testnet": ["cd deploy/testnet && devbox services up"],
|
||||||
],
|
"start-gex": ["go install github.com/cosmos/gex@latest", "gex"]
|
||||||
"start-gex": [
|
|
||||||
"go install github.com/cosmos/gex@latest",
|
|
||||||
"gex"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
48
devbox.lock
48
devbox.lock
@ -97,6 +97,54 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"gum@latest": {
|
||||||
|
"last_modified": "2024-11-16T04:25:12Z",
|
||||||
|
"resolved": "github:NixOS/nixpkgs/34a626458d686f1b58139620a8b2793e9e123bba#gum",
|
||||||
|
"source": "devbox-search",
|
||||||
|
"version": "0.14.5",
|
||||||
|
"systems": {
|
||||||
|
"aarch64-darwin": {
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "out",
|
||||||
|
"path": "/nix/store/rzqm62ixipbzbhfagqlic5xxag9a2v82-gum-0.14.5",
|
||||||
|
"default": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"store_path": "/nix/store/rzqm62ixipbzbhfagqlic5xxag9a2v82-gum-0.14.5"
|
||||||
|
},
|
||||||
|
"aarch64-linux": {
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "out",
|
||||||
|
"path": "/nix/store/3ick2j8z9jgkk3cyc1ik4zkbs3m4583n-gum-0.14.5",
|
||||||
|
"default": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"store_path": "/nix/store/3ick2j8z9jgkk3cyc1ik4zkbs3m4583n-gum-0.14.5"
|
||||||
|
},
|
||||||
|
"x86_64-darwin": {
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "out",
|
||||||
|
"path": "/nix/store/9rh8qxbxgb07v3a62mx9404ynk2yhxrj-gum-0.14.5",
|
||||||
|
"default": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"store_path": "/nix/store/9rh8qxbxgb07v3a62mx9404ynk2yhxrj-gum-0.14.5"
|
||||||
|
},
|
||||||
|
"x86_64-linux": {
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "out",
|
||||||
|
"path": "/nix/store/1bnivwijzrnzx5h0hd5rywwy8rlhxmw5-gum-0.14.5",
|
||||||
|
"default": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"store_path": "/nix/store/1bnivwijzrnzx5h0hd5rywwy8rlhxmw5-gum-0.14.5"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"ipfs@latest": {
|
"ipfs@latest": {
|
||||||
"last_modified": "2023-02-24T09:01:09Z",
|
"last_modified": "2023-02-24T09:01:09Z",
|
||||||
"resolved": "github:NixOS/nixpkgs/7d0ed7f2e5aea07ab22ccb338d27fbe347ed2f11#ipfs",
|
"resolved": "github:NixOS/nixpkgs/7d0ed7f2e5aea07ab22ccb338d27fbe347ed2f11#ipfs",
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
|||||||
"name": "@onsonr/nebula",
|
"name": "@onsonr/nebula",
|
||||||
"version": "0.0.2",
|
"version": "0.0.2",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "bunx tailwindcss -i ./components/globals.css -o ./components/styles/styles.css"
|
"build": "bunx tailwindcss -i ./globals.css -o ./dist/styles.css"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tailwindcss/forms": "^0.5.7",
|
"@tailwindcss/forms": "^0.5.7",
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
go install github.com/cosmos/gex@latest
|
|
||||||
go install github.com/apple/pkl-go/cmd/pkl-gen-go@latest
|
|
||||||
|
|
||||||
rm -rf ~/.ipfs
|
rm -rf ~/.ipfs
|
||||||
|
|
17
scripts/tailwindgen.sh
Executable file
17
scripts/tailwindgen.sh
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
ROOT_DIR=$(git rev-parse --show-toplevel)
|
||||||
|
STYLES_DIR=$ROOT_DIR/pkg/webapp
|
||||||
|
DIST_DIR=$STYLES_DIR/dist
|
||||||
|
OUT_DIR=$ROOT_DIR/static/css
|
||||||
|
|
||||||
|
cd $STYLES_DIR
|
||||||
|
bun install
|
||||||
|
bun run build
|
||||||
|
mkdir -p $OUT_DIR
|
||||||
|
mv $DIST_DIR/styles.css $OUT_DIR/styles.css
|
||||||
|
rm -rf $DIST_DIR
|
||||||
|
rm -rf $STYLES_DIR/node_modules
|
||||||
|
|
@ -12,3 +12,6 @@ for dir in .out/*/; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
rm -rf .out
|
rm -rf .out
|
||||||
|
|
||||||
|
rclone copy $ROOT_DIR/static "r2:nebula"
|
||||||
|
rm -rf $ROOT_DIR/static
|
Loading…
x
Reference in New Issue
Block a user