Update deployment

This commit is contained in:
2026-06-12 13:05:32 +08:00
parent d3072e7e18
commit b97bd85533
12 changed files with 48 additions and 128 deletions
+3 -7
View File
@@ -10,9 +10,7 @@ Go rewrite for the old BotanJS dynamic resource resolver.
## Generate the class map
```sh
go run ./cmd/botan-gen \
-src /path/to/BotanJS/src \
-out internal/generated/classmap_gen.go
make resolver-gen
```
Commit the generated file if the source tree is mostly static. Generate it in CI if the source changes frequently.
@@ -20,7 +18,7 @@ Commit the generated file if the source tree is mostly static. Generate it in CI
## Run API
```sh
go run ./cmd/botan-api -src /path/to/BotanJS/src -addr :8080
make run-api-server
```
Examples:
@@ -43,6 +41,4 @@ Prefix an item with `-` to exclude it.
## TODO
- Test against the old python resolver output
- Add an output interface so JS can be piped directly to a Closure Compiler server.
- Put generated classmap in a separate package if multiple services need to import it.
- Fix moderen closure errors
+1
View File
@@ -0,0 +1 @@
../botanjs/
+3 -3
View File
@@ -19,15 +19,15 @@ RUN --mount=type=cache,target=/go/pkg/mod \
CGO_ENABLED=0 \
GOOS=$TARGETOS \
GOARCH=$TARGETARCH \
go build -trimpath -o /out/botan-api -ldflags='-s -w' ./cmd/botan-api
go build -trimpath -o /out/api-server -ldflags='-s -w' ./cmd/api-server
RUN mkdir -p /out/tmp && chmod 1777 /out/tmp
FROM scratch
COPY --from=build /out/botan-api /usr/local/bin/botan-api
COPY --from=build /out/api-server /usr/local/bin/api-server
COPY --from=build /workspace/src "./src"
COPY --from=build /out/tmp /tmp
EXPOSE 8080/tcp
ENTRYPOINT ["/usr/local/bin/botan-api", "-src", "./src", "-addr", ":8080"]
ENTRYPOINT ["/usr/local/bin/api-server", "-src", "./src", "-addr", ":8080"]
@@ -2,5 +2,5 @@ package generated
const (
IMAGE_TAG = "dev"
Timestamp = "20260612.043857"
Timestamp = "20260612.044857"
)
-1
View File
@@ -1 +0,0 @@
../botanjs/src