Files

35 lines
1.0 KiB
Makefile
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
.PHONY: help build run run-once logs clean install-cron local
help:
@echo "🪖 军事科技每日摘要系统 V3"
@echo "================================"
@echo "可用命令:"
@echo " make build - 构建 Docker 镜像"
@echo " make run-once - 执行一次(Docker"
@echo " make local - 本地直接执行"
@echo " make logs - 查看日志"
@echo " make clean - 清理"
@echo " make install-cron - 安装宿主机定时任务"
build:
docker-compose build
run-once:
docker-compose run --rm military-digest
local:
python3 scripts/military_daily_report_v3.py
logs:
tail -f logs/daily_report.log 2>/dev/null || echo "暂无日志"
clean:
docker-compose down -v
rm -rf output/* logs/*
install-cron:
@echo "正在安装定时任务(每日 8:00 执行)..."
(crontab -l 2>/dev/null | grep -v "military_digest"; echo "0 8 * * * cd $(shell pwd) && python3 scripts/military_daily_report_v3.py >> logs/cron.log 2>&1") | crontab -
@echo "✅ 定时任务已安装"
@crontab -l | grep "military_digest"