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:
parent
0b8a6e947c
commit
2ef54b4218
5 changed files with 21 additions and 258 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,3 +1,5 @@
|
|||
data
|
||||
frontend/app.css
|
||||
frontend/app.js
|
||||
node_modules
|
||||
wiki
|
||||
|
|
|
@ -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 \
|
||||
|
|
20
Makefile
20
Makefile
|
@ -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
252
frontend/app.js
252
frontend/app.js
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue