# Copyright 2025-2026 Thomas Hintz

# This file is part of Nassella.

# Nassella is free software: you can redistribute it and/or modify it under the
# terms of the GNU Affero General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later version.

# Nassella is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

# You should have received a copy of the GNU Affero General Public License
# along with Nassella. If not, see <https://www.gnu.org/licenses/>.

dockerall:
	docker buildx build --platform linux/amd64,linux/arm64 -t nassella/b0.0.1 .

dockerlocal:
	docker buildx build -t nassella/b0.0.1 .

dockerpush:
	docker push nassella/b0.0.1

local:
	docker run -p 8080:8080 --net=host --rm nassella/b0.0.1

localclean:
	docker run -p 8080:8080 --net=host --rm nassella/b0.0.1 --clean

dev_db:
	sudo docker compose up

dev_run:
	make dockerall && make dockerpush && csi -D dev -s run.scm

dev_psql:
	docker run -it --rm --network host -e PGPASSWORD="password" postgres psql -h 127.0.0.1 -U "nassella" -d "nassella"

dev_runhook:
	curl -X POST -H "Content-Type: application/json" -d '{"path":"/","tag":"test4","request_id":"2","version":0}' https://nassella-instance-control.nassella.org/hooks/queue-restic-snapshot
