Skip to content

Commit

Permalink
WASM / Vercel docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zegl committed Jul 12, 2024
1 parent 8641157 commit 95589f8
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module github.com/zegl/kube-score

require (
github.com/buildkite/terminal-to-html v3.2.0+incompatible
github.com/eidolon/wordwrap v0.0.0-20161011182207-e0f54129b8bb
github.com/fatih/color v1.17.0
github.com/google/go-cmp v0.6.0
Expand All @@ -16,7 +17,6 @@ require (
)

require (
github.com/buildkite/terminal-to-html v3.2.0+incompatible // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
Expand All @@ -39,4 +39,4 @@ require (

go 1.22.0

toolchain go1.22.2
toolchain go1.22.4
4 changes: 4 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"buildCommand": "dnf install -y go && go env && go install golang.org/dl/go1.22.5@latest && /vercel/go/bin/go1.22.5 download && GOOS=js GOARCH=wasm /vercel/go/bin/go1.22.5 build -o ./web/main.wasm ./cmd/wasm/main.go",
"outputDirectory": "./web"
}
1 change: 1 addition & 0 deletions web/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.wasm
22 changes: 22 additions & 0 deletions web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# The kube-score website

This directory contains the source for kube-score.com.

kube-score is compiled to WASM (WebAssembly) for usage in browsers, and kube-score.com is running purely in the browser.

## Building

```bash
# Compile the wasm module (run from repo root)
GOOS=js GOARCH=wasm go build -o ./web/main.wasm ./cmd/wasm/main.go
```

```bash
# Start a webserver serving files
python3 -m http.server
```

## Hosting

The site is built and hosted on Vercel. See vercel.json for build configuration.

4 changes: 4 additions & 0 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ <h1>kube-score</h1>
Use this website to easily test kube-score, just paste your object definition YAML or JSON in the box below.
</p>

<p>
This tool is running 100% in your browser, no data is sent to any server!
</p>

<textarea id="kube-score-input">
apiVersion: apps/v1
kind: Deployment
Expand Down

0 comments on commit 95589f8

Please sign in to comment.