aboutsummaryrefslogtreecommitdiff
path: root/GNUmakefile
diff options
context:
space:
mode:
authorJulien Dessaux2022-10-19 23:20:56 +0200
committerJulien Dessaux2022-10-20 00:10:18 +0200
commit28424a589d111ae62810eb22e142f01c89586ed8 (patch)
tree465bc471ef32f424562723f5d197eb23d7ef5991 /GNUmakefile
parentAdded makefile (diff)
downloadgrenade-brothers-28424a589d111ae62810eb22e142f01c89586ed8.tar.gz
grenade-brothers-28424a589d111ae62810eb22e142f01c89586ed8.tar.bz2
grenade-brothers-28424a589d111ae62810eb22e142f01c89586ed8.zip
Added build with buildah and deploy to kubernetes
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile22
1 files changed, 18 insertions, 4 deletions
diff --git a/GNUmakefile b/GNUmakefile
index aa000bc..e749412 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -1,20 +1,34 @@
SHELL:=bash
+REVISION=$(shell git rev-parse HEAD)
.PHONY: build
-build: ## make build # Builds a cartridge
- zig build
+build: ## make build # Builds a cartridge
+ zig build -Drelease-small=true
+
+.PHONY: buildah
+buildah: ## make buildah # Builds the container image
+ deploy/build-image.sh
+
+.PHONY: deploy
+deploy: ## make deploy # deploy the cartridge the active kubernetes context
+ sed -i deploy/kubernetes.yaml -e 's/^\(\s*image:[^:]*:\).*$$/\1$(REVISION)/'
+ kubectl apply -f deploy/kubernetes.yaml
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
.PHONY: init
-init: ## make init # initialize project dependencies
+init: ## make init # initialize project dependencies
npm install wasm4
rm package.json package-lock.json # w4 will think it is an AssemblyScript game if we leave these files
+.PHONY: push
+push: ## make push # push the built image to quay.io
+ buildah push adyxax/grenade-brothers quay.io/adyxax/grenade-brothers:$(REVISION)
+
.PHONY: serve
-serve: ## make serve # run a nodejs web server
+serve: ## make serve # run a nodejs web server
node_modules/.bin/w4 watch --no-open --no-qr
.DEFAULT_GOAL := help