File tree Expand file tree Collapse file tree 5 files changed +51
-45
lines changed
Expand file tree Collapse file tree 5 files changed +51
-45
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ FROM ubuntu:24.04 AS builder
77RUN apt-get update && apt-get install -y \
88 curl \
99 git \
10- make \
1110 ca-certificates \
1211 && rm -rf /var/lib/apt/lists/*
1312
@@ -25,8 +24,8 @@ ENV CGO_ENABLED=0
2524ENV GOOS=linux
2625ENV GOARCH=amd64
2726
28- # Build the application using make
29- RUN make build/ chromad
27+ # Build the application using just
28+ RUN just chromad
3029
3130# Runtime stage
3231FROM alpine:3.23 AS runtime
Original file line number Diff line number Diff line change 1+ set positional-arguments := true
2+ set shell := [" bash" , " -c" ]
3+
4+ version := ` git describe --tags --dirty --always `
5+
6+ _ help :
7+ @ just -l
8+
9+ # Generate README.md from lexer definitions
10+ readme :
11+ #!/usr/bin/env sh
12+ GOOS= GOARCH= ./ table.py
13+
14+ # Generate tokentype_string.go
15+ tokentype-string :
16+ go generate
17+
18+ # Format JavaScript files
19+ format-js :
20+ biome format --write cmd/ chromad/ static/ index.js cmd/ chromad/ static/ chroma.js
21+
22+ # Build chromad binary
23+ chromad : wasm-exec chroma-wasm
24+ rm -rf build
25+ esbuild --platform=node --bundle cmd/ chromad/ static/ index.js --minify --outfile=cmd/ chromad/ static/ index.min.js
26+ esbuild --bundle cmd/ chromad/ static/ index.css --minify --outfile=cmd/ chromad/ static/ index.min.css
27+ cd cmd/ chromad && CGOENABLED=0 go build -ldflags=" -X 'main.version={{ version }} '" -o ../ ../ build/ chromad .
28+
29+ # Copy wasm_exec.js from TinyGo
30+ wasm-exec :
31+ #!/usr/bin/env sh
32+ tinygoroot=$(tinygo env TINYGOROOT)
33+ install -m644 " $tinygoroot/targets/wasm_exec.js" cmd/ chromad/ static/ wasm_exec.js
34+
35+ # Build WASM binary
36+ chroma-wasm :
37+ #!/usr/bin/env sh
38+ if type tinygo > / dev/ null 2 >&1 ; then
39+ tinygo build -no-debug -target wasm -o cmd/ chromad/ static/ chroma.wasm cmd/ libchromawasm/ main.go
40+ else
41+ GOOS=js GOARCH=wasm go build -o cmd/ chromad/ static/ chroma.wasm cmd/ libchromawasm/ main.go
42+ fi
43+
44+ # Upload chromad to server
45+ upload : chromad
46+ scp build/ chromad root@swapoff.org:
47+ ssh root@swapoff.org ' install -m755 ./chromad /srv/http/swapoff.org/bin && service chromad restart'
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ hermit
Original file line number Diff line number Diff line change 1+ .just-1.46.0.pkg
You can’t perform that action at this time.
0 commit comments