2024-01-09 22:12:25 +01:00
|
|
|
#!/usr/bin/env just --justfile
|
|
|
|
|
|
|
|
default: show_receipts
|
|
|
|
|
|
|
|
set shell := ["bash", "-uc"]
|
|
|
|
set dotenv-load
|
|
|
|
|
|
|
|
show_receipts:
|
2024-02-20 08:34:56 +01:00
|
|
|
just --list
|
2024-01-09 22:12:25 +01:00
|
|
|
|
|
|
|
show_system_info:
|
|
|
|
@echo "=================================="
|
|
|
|
@echo "os : {{os()}}"
|
|
|
|
@echo "arch: {{arch()}}"
|
|
|
|
@echo "justfile dir: {{justfile_directory()}}"
|
|
|
|
@echo "invocation dir: {{invocation_directory()}}"
|
|
|
|
@echo "running dir: `pwd -P`"
|
|
|
|
@echo "=================================="
|
|
|
|
|
|
|
|
setup:
|
2024-02-20 08:34:56 +01:00
|
|
|
asdf install
|
|
|
|
lefthook install
|
2024-01-09 22:12:25 +01:00
|
|
|
|
|
|
|
create_venv:
|
|
|
|
@echo "creating venv"
|
2024-02-20 08:34:56 +01:00
|
|
|
python3 -m pip install --upgrade pip setuptools wheel
|
|
|
|
python3 -m venv venv
|
2024-01-09 22:12:25 +01:00
|
|
|
|
|
|
|
install_deps:
|
|
|
|
@echo "installing dependencies"
|
2024-02-20 08:34:56 +01:00
|
|
|
python3 -m hatch dep show requirements --project-only > /tmp/requirements.txt
|
|
|
|
pip3 install -r /tmp/requirements.txt
|
2024-01-09 22:12:25 +01:00
|
|
|
|
|
|
|
install_deps_dev:
|
|
|
|
@echo "installing dev dependencies"
|
2024-02-20 08:34:56 +01:00
|
|
|
python3 -m hatch dep show requirements --project-only > /tmp/requirements.txt
|
|
|
|
python3 -m hatch dep show requirements --env-only >> /tmp/requirements.txt
|
|
|
|
pip3 install -r /tmp/requirements.txt
|
2024-01-09 22:12:25 +01:00
|
|
|
|
|
|
|
create_reqs:
|
|
|
|
@echo "creating requirements"
|
2024-02-20 08:34:56 +01:00
|
|
|
pipreqs --force --savepath requirements.txt src/octodns_netbox_dns
|
2024-01-09 22:12:25 +01:00
|
|
|
|
|
|
|
lint:
|
|
|
|
just show_system_info
|
2024-02-20 08:34:56 +01:00
|
|
|
hatch run lint:style
|
|
|
|
hatch run lint:typing
|
2024-01-09 22:12:25 +01:00
|
|
|
|
|
|
|
format:
|
|
|
|
just show_system_info
|
2024-02-20 08:34:56 +01:00
|
|
|
hatch run lint:fmt
|
|
|
|
|
|
|
|
check:
|
|
|
|
just lint
|
2024-02-21 14:48:11 +01:00
|
|
|
just format
|
2024-02-20 08:34:56 +01:00
|
|
|
|
|
|
|
build:
|
|
|
|
hatch build --clean
|
2024-02-21 14:48:11 +01:00
|
|
|
|
2024-02-21 14:59:19 +01:00
|
|
|
test:
|
|
|
|
hatch run default:test
|
|
|
|
|
2024-02-21 14:48:11 +01:00
|
|
|
up:
|
|
|
|
docker compose -f dev/compose.yml up
|
|
|
|
|
|
|
|
down:
|
|
|
|
docker compose -f dev/compose.yml down
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf dev/db-data/*
|
|
|
|
rm -rf dev/redis-data/*
|
|
|
|
rm -rf dev/netbox-data/*
|
|
|
|
|
|
|
|
sync *flags:
|
|
|
|
cd dev && octodns-sync --debug --config-file sync.yml --force {{ flags }}
|
|
|
|
|
|
|
|
dump *flags:
|
|
|
|
cd dev && octodns-dump --debug --config-file sync.yml --output-dir output {{ flags }} '*' netbox
|
|
|
|
|
|
|
|
validate *flags:
|
|
|
|
cd dev && octodns-validate --debug --config-file sync.yml {{ flags }}
|