feat: build docker images with version numbers
This commit is contained in:
parent
341e6f724b
commit
792825a73e
4
Makefile
4
Makefile
@ -1,4 +1,5 @@
|
||||
TMUX_SESSION=knowyt
|
||||
VERSION=v$(shell grep version client/package.json | cut -d\" -f4)
|
||||
|
||||
.PHONY: info run-all run-server run-client run-tmux build docker clean
|
||||
|
||||
@ -28,9 +29,10 @@ run-server:
|
||||
$(MAKE) -C server run-loop
|
||||
|
||||
build:
|
||||
echo $(VERSION)
|
||||
(cd client/ && yarn generate)
|
||||
$(MAKE) -C server build
|
||||
$(MAKE) -C docker build save
|
||||
$(MAKE) -C docker build save VERSION="$(VERSION)"
|
||||
|
||||
docker-run:
|
||||
$(MAKE) -C docker run
|
||||
|
@ -1,21 +1,23 @@
|
||||
VERSION=latest
|
||||
|
||||
info:
|
||||
@echo available targets:
|
||||
@perl -ne 'm/^([\w\-]+):/ && print(" $$1\n");' Makefile
|
||||
|
||||
build:
|
||||
cp ../server/knowyt files/
|
||||
podman build --tag knowyt:latest .
|
||||
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:latest
|
||||
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-latest.tar
|
||||
podman save knowyt:latest -o knowyt-latest.tar
|
||||
cd .. && ls -lh docker/knowyt-latest.tar
|
||||
rm -f knowyt-$(VERSION).tar
|
||||
podman save knowyt:$(VERSION) -o knowyt-$(VERSION).tar
|
||||
cd .. && ls -lh docker/knowyt-$(VERSION).tar
|
||||
|
||||
clean:
|
||||
rm -f files/knowyt knowyt-latest.tar
|
||||
rm -f files/knowyt knowyt-$(VERSION).tar
|
||||
|
Loading…
Reference in New Issue
Block a user