add prod automation

This commit is contained in:
sfigato 2024-07-17 22:58:28 +02:00
parent 431b5ebb99
commit 9dd4dceafa
2 changed files with 17 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/out

View File

@ -1,5 +1,6 @@
DOCKER ?= docker
COMPOSE ?= docker compose
PUBLIC_URL ?= https://askar.abbiamoundominio.org
dev-run:
$(COMPOSE) up
@ -9,3 +10,18 @@ dev-stop:
dev-clean:
$(COMPOSE) down --volumes
dev-dump:
mariadb-dump -h 127.0.0.1 -P 3306 --user root --password=toor askar > ./assets/db/dump.sql
./out:
mkdir ./out
prepare: ./out prepare-image prepare-db
prepare-image:
$(DOCKER) build -t unit/askar-website .
$(DOCKER) image save -o out/image.tar unit/askar-website
prepare-db:
cat ./assets/db/dump.sql | sed -e 's;http://localhost:8080;$(PUBLIC_URL);g' > ./out/db.sql