1
0
Fork 0
mirror of https://github.com/Luzifer/wiki.git synced 2024-12-20 02:21:18 +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
frontend/app.css
frontend/app.js
node_modules
wiki

View file

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

View file

@ -1,8 +1,18 @@
default: generate
VERSION := $(shell git describe --tags --always || echo dev)
generate:
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"
default: build
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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long