feat: refactor podman build
This commit is contained in:
parent
1e752467eb
commit
eeb48281e4
@ -2,8 +2,8 @@ pipeline:
|
||||
frontend:
|
||||
image: node:16-alpine
|
||||
commands:
|
||||
- ( cd client && yarn install )
|
||||
- ( cd client/ && yarn generate )
|
||||
# - ( cd client && yarn install )
|
||||
# - ( cd client/ && yarn generate )
|
||||
- mkdir -p client/.output/public/
|
||||
when:
|
||||
branch: woodpecker
|
||||
@ -17,3 +17,27 @@ pipeline:
|
||||
- make -C server build
|
||||
when:
|
||||
branch: woodpecker
|
||||
|
||||
build-publish:
|
||||
image: mtvb/drone-kaniko
|
||||
settings:
|
||||
reproducible: true
|
||||
username:
|
||||
from_secret: docker.private.gnuher.de.username
|
||||
password:
|
||||
from_secret: docker.private.gnuher.de.password
|
||||
repo: knowyt
|
||||
registry: docker.private.gnuher.de
|
||||
tags: latest
|
||||
when:
|
||||
branch: woodpecker
|
||||
|
||||
notify:
|
||||
image: plugins/matrix
|
||||
settings:
|
||||
homeserver: https://matrix.bw-messenger.de/
|
||||
roomid: wHCOKvEHLUmsNybNwh:matrix.bw-messenger.de
|
||||
username:
|
||||
from_secret: matrix.bw-messenger.de.username
|
||||
password:
|
||||
from_secret: matrix.bw-messenger.de.password
|
||||
|
@ -1,5 +1,5 @@
|
||||
FROM scratch
|
||||
|
||||
EXPOSE 32039
|
||||
COPY files .
|
||||
COPY build/files .
|
||||
CMD ["/knowyt"]
|
23
Makefile
23
Makefile
@ -1,5 +1,5 @@
|
||||
TMUX_SESSION=knowyt
|
||||
VERSION=v$(shell grep version client/package.json | cut -d\" -f4)
|
||||
VERSION=$(shell grep version client/package.json | cut -d\" -f4)
|
||||
|
||||
.PHONY: info run-all run-server run-client run-tmux build podman clean
|
||||
|
||||
@ -7,7 +7,7 @@ info:
|
||||
@echo available targets:
|
||||
@perl -ne 'm/^([\w\-]+):/ && print(" $$1\n");' Makefile
|
||||
|
||||
setup
|
||||
setup:
|
||||
@echo "I checking for tools"
|
||||
@for binary in go tmux node yarn npx podman; do \
|
||||
echo -n " $$binary: " ; \
|
||||
@ -48,18 +48,29 @@ build:
|
||||
echo $(VERSION)
|
||||
(cd client/ && yarn generate)
|
||||
$(MAKE) -C server build
|
||||
$(MAKE) -C podman build save VERSION="$(VERSION)"
|
||||
$(MAKE) podman-build
|
||||
$(MAKE) podman-save
|
||||
|
||||
podman-build:
|
||||
cp server/knowyt build/files/
|
||||
podman build --tag knowyt:$(VERSION) .
|
||||
|
||||
podman-save:
|
||||
rm -f build/knowyt-$(VERSION).tar
|
||||
podman save knowyt:$(VERSION) -o build/knowyt-$(VERSION).tar
|
||||
ls -lh build/knowyt-$(VERSION).tar
|
||||
|
||||
podman-run:
|
||||
$(MAKE) -C podman run
|
||||
podman run --rm -it -p 32039:32039 -v $$(PWD)/server/data/:/data --name knowyt knowyt:$(VERSION)
|
||||
|
||||
run-standalone:
|
||||
$(MAKE) -C server run-standalone
|
||||
podman-stop:
|
||||
podman stop knowyt
|
||||
|
||||
clean:
|
||||
rm -rf client/.output/
|
||||
rm -rf client/.nuxt/
|
||||
$(MAKE) -C server clean
|
||||
rm -f build/files/knowyt build/knowyt-*.tar
|
||||
|
||||
reset-data:
|
||||
rm -rf server/data/
|
||||
|
0
podman/.gitignore → build/.gitignore
vendored
0
podman/.gitignore → build/.gitignore
vendored
@ -1,23 +0,0 @@
|
||||
VERSION=latest
|
||||
|
||||
info:
|
||||
@echo available targets:
|
||||
@perl -ne 'm/^([\w\-]+):/ && print(" $$1\n");' Makefile
|
||||
|
||||
build:
|
||||
cp ../server/knowyt files/
|
||||
podman build --tag knowyt:$(VERSION) .
|
||||
|
||||
run:
|
||||
podman run --rm -it -p 32039:32039 -v /home/settel/codes/go/knowyt/server/data/:/data --name knowyt knowyt:$(VERSION)
|
||||
|
||||
stop:
|
||||
podman stop knowyt
|
||||
|
||||
save:
|
||||
rm -f knowyt-$(VERSION).tar
|
||||
podman save knowyt:$(VERSION) -o knowyt-$(VERSION).tar
|
||||
cd .. && ls -lh podman/knowyt-$(VERSION).tar
|
||||
|
||||
clean:
|
||||
rm -f files/knowyt knowyt-$(VERSION).tar
|
@ -20,9 +20,6 @@ run-loop:
|
||||
-r _run-inotify-restart \
|
||||
-- $(MAKE) '$$TARGET'
|
||||
|
||||
run-standalone:
|
||||
cd src/ && ../knowyt
|
||||
|
||||
_run-endless-loop:
|
||||
while true; do $(MAKE) run || sleep 3; done
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user