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
|
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
|
.PHONY: info run-all run-server run-client run-tmux build docker clean
|
||||||
|
|
||||||
@ -28,9 +29,10 @@ run-server:
|
|||||||
$(MAKE) -C server run-loop
|
$(MAKE) -C server run-loop
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
echo $(VERSION)
|
||||||
(cd client/ && yarn generate)
|
(cd client/ && yarn generate)
|
||||||
$(MAKE) -C server build
|
$(MAKE) -C server build
|
||||||
$(MAKE) -C docker build save
|
$(MAKE) -C docker build save VERSION="$(VERSION)"
|
||||||
|
|
||||||
docker-run:
|
docker-run:
|
||||||
$(MAKE) -C docker run
|
$(MAKE) -C docker run
|
||||||
|
@ -1,21 +1,23 @@
|
|||||||
|
VERSION=latest
|
||||||
|
|
||||||
info:
|
info:
|
||||||
@echo available targets:
|
@echo available targets:
|
||||||
@perl -ne 'm/^([\w\-]+):/ && print(" $$1\n");' Makefile
|
@perl -ne 'm/^([\w\-]+):/ && print(" $$1\n");' Makefile
|
||||||
|
|
||||||
build:
|
build:
|
||||||
cp ../server/knowyt files/
|
cp ../server/knowyt files/
|
||||||
podman build --tag knowyt:latest .
|
podman build --tag knowyt:$(VERSION) .
|
||||||
|
|
||||||
run:
|
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:
|
stop:
|
||||||
podman stop knowyt
|
podman stop knowyt
|
||||||
|
|
||||||
save:
|
save:
|
||||||
rm -f knowyt-latest.tar
|
rm -f knowyt-$(VERSION).tar
|
||||||
podman save knowyt:latest -o knowyt-latest.tar
|
podman save knowyt:$(VERSION) -o knowyt-$(VERSION).tar
|
||||||
cd .. && ls -lh docker/knowyt-latest.tar
|
cd .. && ls -lh docker/knowyt-$(VERSION).tar
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f files/knowyt knowyt-latest.tar
|
rm -f files/knowyt knowyt-$(VERSION).tar
|
||||||
|
Loading…
Reference in New Issue
Block a user