data/ is gitignored so seed files are not tracked. The recheck glob in stg_playtomic_availability requires at least one matching file or DuckDB throws IOException. Run 'make init-landing-seeds' after a fresh clone. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
48 lines
1.7 KiB
Makefile
48 lines
1.7 KiB
Makefile
TAILWIND := ./bin/tailwindcss
|
|
|
|
bin/tailwindcss:
|
|
@mkdir -p bin
|
|
curl -sLo bin/tailwindcss https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64
|
|
chmod +x bin/tailwindcss
|
|
|
|
# Create seed files for SQLMesh staging models that require at least one landing file.
|
|
# Run once after a fresh clone (data/ is gitignored so seeds are not in git).
|
|
init-landing-seeds:
|
|
@python3 -c "
|
|
import gzip, json, os, pathlib
|
|
seed = {'date':'1970-01-01','captured_at_utc':'1970-01-01T00:00:00Z','venue_count':0,'venues_errored':0,'venues':[]}
|
|
morning = pathlib.Path('data/landing/playtomic/1970/01/availability_1970-01-01.json.gz')
|
|
recheck = pathlib.Path('data/landing/playtomic/1970/01/availability_1970-01-01_recheck_00.json.gz')
|
|
morning.parent.mkdir(parents=True, exist_ok=True)
|
|
for p in [morning, recheck]:
|
|
if not p.exists():
|
|
with gzip.open(p, 'wt') as f: json.dump(seed, f)
|
|
print('created', p)
|
|
else:
|
|
print('exists ', p)
|
|
"
|
|
|
|
css-build: bin/tailwindcss
|
|
$(TAILWIND) -i web/src/padelnomics/static/css/input.css -o web/src/padelnomics/static/css/output.css --minify
|
|
|
|
css-watch: bin/tailwindcss
|
|
$(TAILWIND) -i web/src/padelnomics/static/css/input.css -o web/src/padelnomics/static/css/output.css --watch
|
|
|
|
# -- Secrets (SOPS + age) --
|
|
# .env.*.sops files use dotenv format but sops can't infer from the extension,
|
|
# so we pass --input-type / --output-type explicitly.
|
|
|
|
SOPS_DOTENV := sops --input-type dotenv --output-type dotenv
|
|
|
|
secrets-decrypt-dev:
|
|
$(SOPS_DOTENV) --decrypt .env.dev.sops > .env
|
|
|
|
secrets-decrypt-prod:
|
|
$(SOPS_DOTENV) --decrypt .env.prod.sops > .env
|
|
|
|
secrets-edit-dev:
|
|
$(SOPS_DOTENV) .env.dev.sops
|
|
|
|
secrets-edit-prod:
|
|
$(SOPS_DOTENV) .env.prod.sops
|