1
0
Fork 0
mirror of https://github.com/Luzifer/wiki.git synced 2024-11-09 15:20:07 +00:00

CI: Build app code on-demand

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2024-01-30 16:30:19 +01:00
parent 0b8a6e947c
commit 2ef54b4218
Signed by: luzifer
SSH key fingerprint: SHA256:/xtE5lCgiRDQr8SLxHMS92ZBlACmATUmF1crK16Ks4E
5 changed files with 21 additions and 258 deletions

2
.gitignore vendored
View file

@ -1,3 +1,5 @@
data data
frontend/app.css
frontend/app.js
node_modules node_modules
wiki wiki

View file

@ -7,6 +7,10 @@ RUN set -ex \
&& apk --no-cache add \ && apk --no-cache add \
curl \ curl \
git \ git \
make \
nodejs \
npm \
&& make frontend \
&& go build \ && go build \
-ldflags "-X main.version=$(git describe --tags --always || echo dev)" \ -ldflags "-X main.version=$(git describe --tags --always || echo dev)" \
-mod=readonly \ -mod=readonly \

View file

@ -1,8 +1,18 @@
default: generate VERSION := $(shell git describe --tags --always || echo dev)
generate: default: build
docker run --rm -ti -v $(CURDIR):$(CURDIR) -w $(CURDIR)/src node:alpine \
sh -exc "npm ci && node ci/build.mjs && chown -R $(shell id -u) ../frontend node_modules"
publish: build: frontend
go build \
-ldflags "-s -w -X main.version=$(version)" \
-mod=readonly \
-trimpath
frontend: node_modules
node ci/build.mjs
node_modules:
npm ci
publish: frontend
bash ./ci/build.sh bash ./ci/build.sh

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long